Friday, January 20, 2012

Nagios

After Nagios install two local host service checks fail, check_http & check_ssh. Check_http is looking for index.html, but can't find it. Check_ssh isn't working because I'm using non-standard ssh port 3509, instead of port 22. Here's how to solve both problems.

My setup-
VMWare 5.0
CentOS 5.7
Nagios Core 3.2.3


1)Solving check_http-

Create index.html file under http root directory.
[root@nagios]# cd /var/www/html
[root@nagios]# touch index.html

Confirm at command line-
[root@nagios]# /usr/lib64/nagios/plugins/check_http nagios




2)Solving check_ssh-

[root@nagios]#vi /etc/nagios/objects/localhost.cfg

Change the argument on the check_command line, like this-

FROM:
define service{
use local-service ; Name of service template to use
host_name nagios.local
service_description SSH
=> check_command check_ssh
notifications_enabled 0
}


TO:
define service{
use local-service ; Name of service template to use
host_name nagios.local
service_description SSH
=> check_command check_ssh!-p 3509
notifications_enabled 0
}

Save the edits and exit vi.
:wq

Confirm at command line-
[root@nagios]# /usr/lib64/nagios/plugins/check_ssh -p 3509 nagios

Restart web services and Nagios.
[root@nagios]# service httpd reload
[root@nagios]# service nagios reload

No comments: