Monitor only service

This forum is intended for the discussion of Nagios plugin development. Feature requests, patches, bug fixes, and all types of development-related discussions are welcome!

NOTE: The SourceForge.net nagiosplug-devel mailing list has been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Monitor only service

Postby afigles » Tue Sep 24, 2019 1:52 am

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

Re: Monitor only service

Postby scottwilkerson » Tue Sep 24, 2019 1:12 pm

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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 17032
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Monitor only service

Postby afigles » Thu Sep 26, 2019 9:41 am

MMM but whats the command for the status?? In my cfg file is not the command.
afigles
 
Posts: 19
Joined: Wed Sep 11, 2019 12:15 pm

Re: Monitor only service

Postby scottwilkerson » Thu Sep 26, 2019 9:46 am

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$
}
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 17032
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Monitor only service

Postby afigles » Thu Sep 26, 2019 11:15 am

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

Re: Monitor only service

Postby scottwilkerson » Thu Sep 26, 2019 11:30 am

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
        }
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 17032
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Monitor only service

Postby afigles » Fri Sep 27, 2019 1:14 am

Great! Thanks!
afigles
 
Posts: 19
Joined: Wed Sep 11, 2019 12:15 pm

Re: Monitor only service

Postby scottwilkerson » Fri Sep 27, 2019 7:01 am

afigles wrote:Great! Thanks!

glad it is resolved

Locking thread
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 17032
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises


Return to Nagios Plugin Development

Who is online

Users browsing this forum: No registered users and 3 guests