Is there a simple way to add a custom command to the host config section in Nagios?
I have several web servers running on various ports and hosts, and it seems tedious to have to create a hostgroup, service and command definition (ok, command can take the port and url as parameters) for each different "one of a kind" service I want to check.
I do realize I'm sacrificing extensibility by going this route, but is there a simpler way. or am I thinking about the problem wrong?
-
If you just want to check a list of URLs then you could (1) define one host with a no-op host check, (2) define one service used by that host, (3) set the check command for that service to run a script, and (4) write a script that checks (via calling check_http) each url in a file.
All that would be a one-time set up. When you get a new URL you would add it to the file.
From embobo -
I've done something similar by creating one file for all the http checks (using check_http) and treating it as if it was a single server/host. For each http check there's only one service to define. No host groups required.
From John Gardeniers
0 comments:
Post a Comment