このコンテンツは選択した言語では利用できません。

13.5. Nagios Advanced Configuration


13.5.1. Creating Nagios User

To create a new Nagios user and set permissions for that user, follow the steps given below:
  1. Login as root user.
  2. Run the command given below with the new user name and type the password when prompted.
    # htpasswd /etc/nagios/passwd newUserName
    Copy to Clipboard Toggle word wrap
  3. Add permissions for the new user in /etc/nagios/cgi.cfg file as shown below:
    authorized_for_system_information=nagiosadmin,newUserName
    authorized_for_configuration_information=nagiosadmin,newUserName
    authorized_for_system_commands=nagiosadmin,newUserName
    authorized_for_all_services=nagiosadmin,newUserName
    authorized_for_all_hosts=nagiosadmin,newUserName
    authorized_for_all_service_commands=nagiosadmin,newUserName
    authorized_for_all_host_commands=nagiosadmin,newUserName
    Copy to Clipboard Toggle word wrap

    Note

    To set read only permission for users, add authorized_for_read_only=username in the /etc/nagios/cgi.cfg file.
  4. Start Nagios and httpd services using the following commands:
    # service httpd restart
    # service nagios restart
    Copy to Clipboard Toggle word wrap
  5. Verify Nagios access by using the following URL in your browser, and using the user name and password.
    https://NagiosServer-HostName-or-IPaddress/nagios
    Copy to Clipboard Toggle word wrap

    Figure 13.14. Nagios Login

13.5.2. Changing Nagios Password

The default Nagios user name and password is nagiosadmin and nagiosadmin. This value is available in the /etc/nagios/cgi.cfg file.
  1. Login as root user.
  2. To change the default password for the Nagios Administrator user, run the following command with the new password:
    # htpasswd -c /etc/nagios/passwd nagiosadmin
    Copy to Clipboard Toggle word wrap
  3. Start Nagios and httpd services using the following commands:
    # service httpd restart
    # service nagios restart
    Copy to Clipboard Toggle word wrap
  4. Verify Nagios access by using the following URL in your browser, and using the user name and password that was set in Step 2:
    https://NagiosServer-HostName-or-IPaddress/nagios
    Copy to Clipboard Toggle word wrap

    Figure 13.15. Nagios Login

13.5.3. Configuring SSL

For secure access of Nagios URL, configure SSL:
  1. Create a 1024 bit RSA key using the following command:
    openssl genrsa -out /etc/ssl/private/{cert-file-name.key} 1024
    Copy to Clipboard Toggle word wrap
  2. Create an SSL certificate for the server using the following command:
    openssl req -key nagios-ssl.key -new | openssl x509 -out nagios-ssl.crt -days 365 -signkey  nagios-ssl.key -req
    Copy to Clipboard Toggle word wrap
    Enter the server's host name which is used to access the Nagios Server GUI as Common Name.
  3. Edit the /etc/httpd/conf.d/ssl.conf file and add path to SSL Certificate and key files correspondingly for SSLCertificateFile and SSLCertificateKeyFile fields as shown below:
     SSLCertificateFile     /etc/pki/tls/certs/nagios-ssl.crt 
     SSLCertificateKeyFile  /etc/pki/tls/private/nagios-ssl.key
    Copy to Clipboard Toggle word wrap
  4. Edit the /etc/httpd/conf/httpd.conf file and comment the port 80 listener as shown below:
    # Listen 80
    Copy to Clipboard Toggle word wrap
  5. In /etc/httpd/conf/httpd.conf file, ensure that the following line is not commented:
    <Directory "/var/www/html">
    Copy to Clipboard Toggle word wrap
  6. Restart the httpd service on the Nagios server using the following command:
    # service httpd restart
    Copy to Clipboard Toggle word wrap

13.5.4. Integrating LDAP Authentication with Nagios

You can integrate LDAP authentication with Nagios plug-in. To integrate LDAP authentication, follow the steps given below:
  1. In apache configuration file /etc/httpd/conf/httpd.conf, ensure that LDAP is installed and LDAP apache module is enabled.
    The configurations are displayed as given below if the LDAP apache module is enabled.You can enable the LDAP apache module by deleting the # symbol.
    LoadModule ldap_module modules/mod_ldap.so 
    LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
    Copy to Clipboard Toggle word wrap
  2. Edit the nagios.conf file in /etc/httpd/conf.d/nagios.conf with the corresponding values for the following:
    • AuthBasicProvider
    • AuthLDAPURL
    • AuthLDAPBindDN
    • AuthLDAPBindPassword
  3. Edit the CGI authentication file /etc/nagios/cgi.cfg as given below with the path where Nagios is installed.
    nagiosinstallationdir = /usr/local/nagios/ or /etc/nagios/
    Copy to Clipboard Toggle word wrap
  4. Uncomment the lines shown below by deleting # and set permissions for specific users:

    Note

    Replace nagiosadmin and user names with * to give any LDAP user full functionality of Nagios
    authorized_for_system_information=user1,user2,user3 
     
    authorized_for_configuration_information=nagiosadmin,user1,user2,user3 
     
    authorized_for_system_commands=nagiosadmin,user1,user2,user3 
     
    authorized_for_all_services=nagiosadmin,user1,user2,user3 
     
    authorized_for_all_hosts=nagiosadmin,user1,user2,user3 
     
    authorized_for_all_service_commands=nagiosadmin,user1,user2,user3 
     
    authorized_for_all_host_commands=nagiosadmin,user1,user2,user3
    Copy to Clipboard Toggle word wrap
  5. Restart httpd service and Nagios server using the following commands:
    # service httpd restart
    # service nagios restart
    
    Copy to Clipboard Toggle word wrap
トップに戻る
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2025 Red Hat