Monitor only service

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
afigles
Posts: 19
Joined: Wed Sep 11, 2019 12:15 pm

Monitor only service

Post by afigles »

Hello team,

We want to monitor only a service, no status host.

I have define the host and the service (check_http) but the console shows the status as Down, how could I no monitor the status host? This is my cfg:

Code: Select all

define host{
        use             linux-server            ; Inherit default values from a template
        host_name       SCTD                    ; The name we're giving to this server
        alias           SCTD                    ; A longer name associated with the server
        address         web.domian.es      ; IP address of the server
        }

define service{                         ###### SCTD web
        use                             local-service         ; Name of service template to use
        host_name                       SCTD
        service_description             HTTP
        check_command                   check_https!/sctd/loginPage.do
        }
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Monitor only service

Post by scottwilkerson »

This is not possible, but it is possible to set the check command to something that is always ok

For example if you have check_dummy command configured you could add the following to the host

Code: Select all

        check_command                   check_dummy!0!OK
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
afigles
Posts: 19
Joined: Wed Sep 11, 2019 12:15 pm

Re: Monitor only service

Post by afigles »

MMM but whats the command for the status?? In my cfg file is not the command.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Monitor only service

Post by scottwilkerson »

The definition for the check_dummy command would be

Code: Select all

define command {
    command_name    check_dummy
    command_line    $USER1$/check_dummy $ARG1$ $ARG2$
}
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
afigles
Posts: 19
Joined: Wed Sep 11, 2019 12:15 pm

Re: Monitor only service

Post by afigles »

But this command will be a new service no??

In the console is the host, status and service. Muy problem is that an host is in AWS cloud and ICMP is not allow and is Down, how could change the value to Unreachable or not check the status??

that is to say, I only monitor the service and not host.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Monitor only service

Post by scottwilkerson »

Change this

Code: Select all

define host{
        use             linux-server            ; Inherit default values from a template
        host_name       SCTD                    ; The name we're giving to this server
        alias           SCTD                    ; A longer name associated with the server
        address         web.domian.es      ; IP address of the server
        }
to this

Code: Select all

define host{
        use             linux-server            ; Inherit default values from a template
        host_name       SCTD                    ; The name we're giving to this server
        alias           SCTD                    ; A longer name associated with the server
        address         web.domian.es      ; IP address of the server
        check_command                   check_dummy!0!OK
        }
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
afigles
Posts: 19
Joined: Wed Sep 11, 2019 12:15 pm

Re: Monitor only service

Post by afigles »

Great! Thanks!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Monitor only service

Post by scottwilkerson »

afigles wrote:Great! Thanks!
glad it is resolved

Locking thread
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked