how to string commands?
Thomas Slutyer
nagios at kilala.nl
Fri Jul 28 10:02:15 CEST 2006
>> I am defining a template for my linux machines. I'd like the
>> check_command for that template to have it check ping, local
>> drive, pop, httpd, etc.... How can I string them together?
>> Would something like this
>> work:
>>
>> check_command check-host-alive; check-pop; etc..
>>
>> or do I need to use commas or is this completely illegal?
>
> It won't work. Each check commad can only have one result.
Whereas Nagios' syntax will not allow for such trickery, you -could-
however make a composite check script yourself. Just create a shell
script that calls all of the checks you want to perform and let the
script decide on the exit code and alarm message, based on the output
of the other checks.
This way I've create "real" service checks for our SMTP environment for
example. Why? Because a mail environment is more than just a running
SMTP daemon. My script checks:
* Are the main SMTP VIPs (Virtual IPs) available in DNS?
* Is the load balancer running the VIP properly?
* How many SMTP servers out of our complete pool are up and available
for SMTP?
* Are we able to connect to send a message.
That way you can safely say that service X works properly :)
Cheers!
Thomas
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list