Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
}

and

command like this in commands.cfg

define command{
 command_name check_http-site1
 command_line /usr/lib/nagios/plugins/check_http -H site1.dreaddomain.com
}

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
add comment

1 Answer 1

up vote 1 down vote accepted
su - nagios -s /bin/bash -c '/usr/lib/nagios/plugins/check_http -H site1.dreaddomain.com'
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
show 3 more comments

Your Answer

 
discard

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.