Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using nagios o centos server and i only want to monitor the localhost only.

I have defined my service like this

define service{
 host_name  localhost
 service_description Site1Service
 check_command  check_http-site1
 use   generic-service
 notification_interval 1440


command like this in commands.cfg

define command{
 command_name check_http-site1
 command_line /usr/lib/nagios/plugins/check_http -H

I am getting critical error in there. so i want to check from command line if that service is running or not

share|improve this question
up vote 1 down vote accepted
su - nagios -s /bin/bash -c '/usr/lib/nagios/plugins/check_http -H'
share|improve this answer
No , i want to check check_http-site1 not check_http. that i know it work – Pandora Jul 9 '13 at 9:42
check_http-site1 is just a command name that actually runs the above command as the nagios user. – quanta Jul 9 '13 at 9:45
yes but i want to know if that is working or not , or i have messed with something – Pandora Jul 10 '13 at 1:34
Have you tried the above command? – quanta Jul 10 '13 at 1:38
yes that is working , but my new command was not working , so i wanted to know how to check that – Pandora Jul 10 '13 at 1:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.