Page 1 of 1

[SOLVED] Define Service and Define Comman Question

Posted: Thu Jan 14, 2016 8:53 am
by nssantos
Hi everyone. I have a question: To define a service I have to define a command, that would be executed by that service, before?

Thx

Re: Define Service and Define Comman Question

Posted: Thu Jan 14, 2016 10:20 am
by rkennedy
There should be some commands already defined located in your commands.cfg, check_http for example will look like this -

Code: Select all

define command {
       command_name                             check_http
       command_line                             $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
}
Then, your host and service definition would be defined like so -

Code: Select all

define host {
        host_name                       google
        alias                           Google Host
        address                         google.com
        max_check_attempts              5
        check_period                    24x7
        notification_interval           30
        notification_period             24x7
}
define service {
        use                             generic-service
        host_name                       google
        service_description             HTTP
        check_command                   check_http
}

Re: Define Service and Define Comman Question

Posted: Thu Jan 14, 2016 12:08 pm
by nssantos
Great example rkennedy, Thanks!!!
I have another question... I have to do anything on targets monitored machines? Or only in my server?

Re: Define Service and Define Comman Question

Posted: Thu Jan 14, 2016 12:15 pm
by tmcdonald
That depends on the type of check being performed. Things like HTTP and ping are able to be checked without modifying the client at all, but if you want to check CPU, memory, disk space, or other information that is not available externally, you will need to install an agent that will listen on a port and perform checks on behalf of Nagios.

Re: Define Service and Define Comman Question

Posted: Tue Jan 19, 2016 11:47 am
by nssantos
tmcdonald wrote:That depends on the type of check being performed. Things like HTTP and ping are able to be checked without modifying the client at all, but if you want to check CPU, memory, disk space, or other information that is not available externally, you will need to install an agent that will listen on a port and perform checks on behalf of Nagios.
I undestand, really make sense, I ask that because the tutorial that a read before didnt explain me right. In the way, that agent that you said is the NRPE?

Re: [SOLVED] Define Service and Define Comman Question

Posted: Tue Jan 19, 2016 1:50 pm
by rkennedy
NRPE is one of the agents, yes. Here's a link with more information about it - https://assets.nagios.com/downloads/nag ... g_NRPE.pdf

Did you have any other questions?