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 asked this question and i'd like to add the service to nagios. nagios is being very strange. I edited /etc/nagios3/conf.d/localhost_nagios2.cfg and changed the text "Current Users" to "Current UseTESTrs" and restarted nagios. It looks like i am editing the right file. It disappeared. I dont know why it didnt just change the text of the description. I hit undo and restarted and the service is still gone. I tried the same thing with total process and that also disappeared rather then rename and undoing/restarting nagios didnt help bring it back (wtf)

So.... I have no idea whats going on but how do i restore those two services and add the check http command to check my 3 website to see if its working or giving me an error (usually a 5xx error)

share|improve this question
    
There are many Nagios tutorials around. Unless you post more specific information about what problem you're having we won't be able to help you any more than the tutorials could. Post your Nagios config files –  sam Dec 9 '11 at 12:56
add comment

1 Answer

up vote 1 down vote accepted

It looks like i am editing the right file.

You can create any config file and make it takes effect by defining cfg_file or cfg_dir option in the main config file (nagios.cfg):

cfg_dir=/etc/nagios3/conf.d

I dont know why it didnt just change the text of the description. I hit undo and restarted and the service is still gone.

You probably should verify the config before restarting nagios service:

# nagios -v /path/to/nagios.cfg

How do I add the check http command to check my 3 website...

Define a command in /nagios_prefix/etc/objects/commands.cfg:

define command{
    command_name    check_http_status
    command_line    $USER1$/check_http -H $ARG1$ -u $ARG2$ -e $ARG3$
    }

and add a service:

define service{
    use                     generic-service
    host_name               web1
    service_description     web1/uri
    check_command           check_http_status!domain.com!/uri!200
    contact_groups          admin
    }
share|improve this answer
    
Thank you! After playing around i figured out why i needed to specify the localhost/ip addr and why testing if sdjhfsdhhf.com is invalid (i was surprised to get a 200). Its working as i expected expect its too bad i cant use more then one check_command in a service –  acidzombie24 Dec 9 '11 at 14:37
add comment

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.