how to string commands?

Dave Stern dave at umiacs.umd.edu
Fri Jul 28 14:08:00 CEST 2006


On Fri, 28 Jul 2006, Thomas Slutyer wrote:

>>> 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 :)
>

Great idea for single services such as smtp but not so good for
overall system health as it's difficult to quantify.

For smtp, you might right a script to 
- see that smtp is running
- see that the spool area has free space
- see that system load is reasonable (que load average for sendmail might
     otherwise start refusing new messages)
....
and finally if all is well, send back a good status, if not, decide on
status (warning or critical) and output appropriate message. But even here,
the problem is that the different things you're checking are not necessarily
reliant on each other so several of the above could have problems and if so,
what should the overall status and output message be.

So by extension, writing a single script to test many unrelated items
defining the overall health of a host can result in confusing output.

  =-=-=-=-=-=-=-=-=-=-  generated by /dev/dave -=-=-=-=-=-=-=-=-=-=-=-=
  David Stern                                    University of Maryland
            Institute for Advanced Computer Studies

-------------------------------------------------------------------------
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