Dynamically generated service checks

David Rosenstrauch darose at darose.net
Wed Jul 15 00:21:35 CEST 2009


Scratching my head as to how it might be possible to accomplish a 
monitoring task I need to do:

We have a database table of tags.  For each tag we have a process that 
generates a Javascript file and pushes it out to a CDN.  I've 
successfully created a service check to monitor that the process runs 
successfully (by using check_mysql_query to verify that a "pushed" date 
gets updated on the database table).  But we also need to monitor that 
each of the files exists - and in the correct version - over at the CDN, 
and here's where I'm hitting a wall.

What I'm envisioning is a way whereby I could dynamically generate a 
whole bunch of service checks - one for each tag in the database table. 
  Each service check would then go and download its corresponding file 
from the CDN, parse it, and verify the version number.  In this way, if 
any particular file was missing or the wrong version, we would get a 
Nagios alert on that tag/file.

However, I don't see any clear way to approach this with Nagios.  Near 
as I can tell there doesn't seem to be any way to dynamically generate 
service checks.  From my reading of the docs, every service need to be 
explicitly listed in the config files beforehand.

I was thinking that perhaps having a cron job that generates passive 
checks might be a solution here, but again it looks like I would still 
need to have the service checks defined beforehand in the nagios config 
files, and couldn't just generate them on-the-fly based on the contents 
of the database table.


Anyone have any ideas on how I could accomplish this file monitoring in 
a dynamic fashion?  (Note that alerting on a file-by-file basis is 
needed here; it would not be sufficient to have a single service check 
that monitors and alerts on all of the files.)

TIA,

DR

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
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