Cool resource macro use

Peter Edmonds termx23 at gmail.com
Tue Mar 20 11:30:00 CET 2007


Thought I'd share this cool use of a resource macro as it solved a
recent problem trying to use the check_http plugin.

I needed to check a web page for today's date in the format YYYYMMDD -
tried passing $(date -d "today" +%Y%m%d) to check_http using the -s
switch, but Nagios kept eating some portion of the date output.

I then set the $USER$31 resource macro to $(date -d "today" +%Y%m%d)
then passed the $USER31$ macro to check_http -s $USER31$

Bingo ! The date command formats today's date correctly and then
passes it to check_http. Another victory for the flexibility of
Nagios.

Oh, you can do stuff like $(date -d "-1 day" +%Y%m%d) too.

I am curious as to what else could be achieved with resource macros
(especially shell arithmetic). Anyone got examples of resource macro
usage ?

Peter

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