[BlueOnyx:07615] Re: Creating Active Monitors

Michael Stauber mstauber at blueonyx.it
Mon Jul 4 22:48:37 -05 2011


Hi Darrell,

> Is it possible for users to write Active Monitors?  I want to write an HP
> monitor that basically Monitors Disk Integrity:
> 
> How would I go about that?
> 
> Active Monitor stuff is not in the developer's guide I have.

Yeah, it's not really that well documented and there is a certain degree of 
fluctuation about how several modules make use of it. So there is actually 
more than one correct way to do it.

Generally there is the module base-am.mod which provides the bare metal 
"Active Monitor" services. And it is modular itself. It checks for other 
existing active monitor modules from various sub packages and then displays 
them as appropriate.

To make a custom active monitor component you need an XML schema file for your 
new active monitor component. You also need a PHP page which displays the info 
inside the main active monitor page. And you need a script (commonly coded in 
either Perl, Bash or Expect) which SWATCH (the shell script run by a cronjob, 
which checks all services) runs to check your newly monitored services for 
functions. This script must report in a certain format if the services status 
light ought to be green, yellow or red. And if the feature or function you 
monitor is disabled, the status light will be white or greyed out. You also 
need some locale files that provide at least text strings for one language. 
That's preferably English, because that's what the GUI defaults to.

Typically it is best to look at a working example to figure out what you need. 
Recently when I wrote the new base-mailman.mod I also had to write an active 
monitor component for it:

http://devel.blueonyx.it/trac/browser/BlueOnyx/5106R/ui/base-mailman.mod

I just took the code of that module, threw everything out that you won't need, 
renamed it and uploaded it as tarball at this location:

http://devel.blueonyx.it/.cam/base-customamcomponent.mod.tar.gz

You still have to make plenty of minor adjustments here and there, because as 
is the included schema file will conflict with Mailman (if installed). So you 
need to rename some variables in the schema file and that will also require 
renaming variables in other files in that module. But all in all this should 
get you jumpstarted and heading into the right direction.

-- 
With best regards

Michael Stauber



More information about the Blueonyx mailing list