|
From: Jamie C. <jca...@we...> - 2005-09-20 00:26:45
|
On Tue, 2005-09-20 at 01:48, Enrique Toledano wrote:
> Hi Jamie and the rest of the list:
>
> I need some advice in a module I'm developing, so I think you'll be so
> kind to help me.
> I have many hosts (more than 200) monitorized with the status module
> of webmin. Now, I want to show the status of all the computers in one
> master host, showing them in a map, and giving them a color in
> function of his actual status, with a new module.
> I think this can be done with the module reading a local file than
> contents the status of all the hosts that have alarms.
> But, what do you think it's the best way to put the status of all the
> hosts in one file of the master host?
> I'm using the onup and ondown commands, but I think it's not the best way.
Hi Enrique,
If you are using the cluster feature of the status module to monitor all
the systems from a single webmin server, then the information about
which monitors are up and down is already available on that master
server. It can be found in the file /etc/webmin/status/oldstatus , which
is a text file in which each line is in the format :
id=status
The 'id' is the ID of a monitor, and status is the result from the last
check. 0 = down, 1 = up, other numbers indicate other types of failures.
You can read that file easily in a webmin module with the read_file
funcion, which converts it into a hash.
The actual details of each monitored services are in files in the
/etc/webmin/status/services directory. You can either read those
directory, or make foreign calls from your module to the status module
to read them, with code like :
&foreign_require("status", "status-lib.pl");
$serv = &status::get_service($id):
- Jamie
|