[SOLVED] Define Service and Define Comman Question

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
nssantos
Posts: 13
Joined: Fri Nov 13, 2015 5:55 am

[SOLVED] Define Service and Define Comman Question

Post 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
Last edited by nssantos on Tue Jan 19, 2016 11:49 am, edited 1 time in total.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Define Service and Define Comman Question

Post 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
}
Former Nagios Employee
nssantos
Posts: 13
Joined: Fri Nov 13, 2015 5:55 am

Re: Define Service and Define Comman Question

Post by nssantos »

Great example rkennedy, Thanks!!!
I have another question... I have to do anything on targets monitored machines? Or only in my server?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Define Service and Define Comman Question

Post 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.
Former Nagios employee
nssantos
Posts: 13
Joined: Fri Nov 13, 2015 5:55 am

Re: Define Service and Define Comman Question

Post 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?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: [SOLVED] Define Service and Define Comman Question

Post 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?
Former Nagios Employee
Locked