Editing
Adding hosts and services to Nagios - Redhat hosts
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
Adding Redhat host to Nagios -------------------------------- 1. Connect to Nagios server (nagios.apoyar with neal username and apoyar.key) #cd /usr/local/etc/nagios/objects/machines #open and edit .cfg file (depending on whether we are adding host for Apoyar or other customers) 2. Add the host name in member list to recognize Nagios probe for checks Save file (:wq!) and exit vi editor Go to below path β’ cd /usr/local/etc/nagios/objects β’ vi services.cfg 3. Add the new hostname to the services, which we need for new server in Nagios to monitor. Save file (:wq!) and exit vi editor 4. Need to create user name with home folder for user #adduser nagios Set password for nagios to access from Nagios server #passwd nagios #cd /home/nagios #mkdir .ssh #mkdir bin 5. After that need to change owner of those folder which is created by root. #chown nagios:nagios .ssh/ -R #chown nagios:nagios bin βR 6. Copy public key (authorized_keys) file from any existing working server to access server password authentication less and change permissions on it as below chmod 500 /home/nagios/.ssh/authorized_keys chown nagios:nagios /home/nagios/.ssh/ authorized_keys then try to ssh new server from nagios server (It should work) 7. Need to install nagios packages on host machine yum install nagios-plugins yum install perl yum install python3-psutil ln -s /bin/python3 /usr/bin/python yum updateinfo dnf install perl-Array-Unique dnf install perl-File-Slurp dnf install perl-Number-Format dnf install perl-utils dnf install nagios-plugins-perl dnf install perl-LWP-Protocol-https 8. Copy required plugins from existing server on new server into bin folder and change permissions on those plugins as below chmod 755 /home/nagios/bin/* chown nagios:nagios /home/nagios/bin/* 9. Run below command on nagios server and check syntax errors with below command /usr/local/bin/nagios -v /usr/local/etc/nagios/nagios.cfg 10. If we got all errors and warning zero, then go to nagios dashboard (nagios.apoyar.eu) and restart the nagios process it.
Summary:
Please note that all contributions to Apoyar Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Apoyar Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
British English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Apoyar Infrastructure
Active Directory
Recent changes
Random page
Upload file
Tools
What links here
Related changes
Special pages
Page information