Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.