Table of Contents

,

Add new check on localhost (nagios itself)

1. Define new command in /usr/local/nagios/etc/commands/

define command {
    command_name    check_my_service
    command_line    $USER1$/check_http -H example.com -u "http://example.com/health/someapi/" -a <username>:<password> 
}

Above is example for checking http with authorization (see check_http –help for options)

2. Add a check with the name of the command that you defined above to /usr/local/nagios/etc/services/

define service{
    use                             generic-service
    service_description             Check for my new service
    check_command                   check_my_service
    host_name                       localhost
}

Tested on

See also

References