How to configure non host service in Nagios?
Asked Answered
D

3

5

I need to monitor some file existence in an AWS S3 bucket and I created a simple Nagios plugin for that. Now I have to configure it and defined it as a command something like this:

define command{
        command_name    check_s3file_exist
        command_line    /usr/lib/nagios/plugins/check_s3_exist.py $ARG1$
}

Now the command needs to be used in service definition but as far as I can see Nagios is centered around the concept of host but S3 isn't a host so I am at a loss where to call this command.

Dickinson answered 17/11, 2012 at 19:39 Comment(0)
D
3

I ended up calling this command from one of the servers Nagios is monitoring. It looks like Nagios monitoring has to be bounded with a host.

Dickinson answered 30/11, 2012 at 17:54 Comment(0)
N
4

you can define virtual host with active checks disabled and passive checks enabled. Then submit passive check result as OK - you will have this status forever.

I created host called "Internet access" with random IP and did what I wrote above because icmp requests to external hosts are not allowed in the network. Then I added some checks of public web pages.

Nitty answered 5/2, 2013 at 9:27 Comment(0)
D
3

I ended up calling this command from one of the servers Nagios is monitoring. It looks like Nagios monitoring has to be bounded with a host.

Dickinson answered 30/11, 2012 at 17:54 Comment(0)
A
1

Nagios is just bound to HOSTNAME defined in its host to check for, as long as you are using predefined commands. In the example below the command there would be predefined as

check_http -H $HOSTNAME$ ...

You are looking for already available command

/usr/lib/nagios/plugins/check_http -H www.google.de -u /maps

where the u Parameter is the desired URI to check for

so just define the command

define command{
    command_name    check_s3file_exist
    command_line    /usr/lib/nagios/plugins/check_http -H $ARG1$ -u $ARG2$
}
Antevert answered 17/11, 2012 at 19:43 Comment(1)
Thanks Matthias but it isn't what I am looking for. I guess my description wasn't very clear. I wrote a script to check a file existence in AWS S3 and I would like to call it from Nagios. But AWS S3 isn't a host and as far as I can see all the service calls need to be associated with a host in Nagios. Probably I can create a fake host or call this service from an existing host but I am hoping to find a cleaner mechanism.Dickinson

© 2022 - 2024 — McMap. All rights reserved.