host monitoring?

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

cwahlin
Cacti User
Posts: 91
Joined: Fri Oct 10, 2003 7:23 am

host monitoring?

Post by cwahlin »

I would like to get up/down working for the hosts in my maps, but there isn't much in the manual yet for this. Has anyone got this working yet?

I ask here because I do not want to bother Howie since he is probably busy with more important things than answering my silly questions :lol:

I saw in the image dir that there are different symbols for up/down/recovering. Does that mean it would be possible to have different icons for host status, and still use different colors for the label (cpu load)?

edit: I found the answer to one of my questions in the manual. Seems you can use different icons for different values using the SET command. I also read about using up/down status, but I do not seem to understand how to use it....

/Carl
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: host monitoring?

Post by Howie »

cwahlin wrote:I would like to get up/down working for the hosts in my maps, but there isn't much in the manual yet for this. Has anyone got this working yet?

I ask here because I do not want to bother Howie since he is probably busy with more important things than answering my silly questions :lol:

I saw in the image dir that there are different symbols for up/down/recovering. Does that mean it would be possible to have different icons for host status, and still use different colors for the label (cpu load)?

edit: I found the answer to one of my questions in the manual. Seems you can use different icons for different values using the SET command. I also read about using up/down status, but I do not seem to understand how to use it....

/Carl
The cactihost: datasource plugin sets a variable called 'state' for the node, which has the name of the state in it. It also returns a number as the actual "bandwidth" value, which is the cacti-internal state number.

So, for Cacti device 33 (the number in the URL on the host.php page)

Code: Select all

NODE mynode
     LABEL my host name
     LABELOFFSET S
     TARGET cactihost:33
     ICON images/nodestatus_{node:this:state}.png
Then create a set of images call nodestatus_up.png, nodestatus_down.png, nodestatus_disabled.png and nodestatus_recovering.png in your images directory.

That should do it. Let me know if it doesn't - this bit is not very well used so far. You're a pioneer :-)
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
streaker69
Cacti Pro User
Posts: 712
Joined: Mon Mar 27, 2006 10:35 am
Location: Psychic Amish Network Administrator

Post by streaker69 »

For those of us that are using custom graphics for our maps, wouldn't we have to create a custom status image for each graphic?

Like for mine, I'd have a MailStatus_up.png MailStatus_down.png MailStatus_disabled.png etc.

So my config line would look like:

ICON images/MailStatus_{node:this:state}.png

Am I correct in thinking this?
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

streaker69 wrote:For those of us that are using custom graphics for our maps, wouldn't we have to create a custom status image for each graphic?

Like for mine, I'd have a MailStatus_up.png MailStatus_down.png MailStatus_disabled.png etc.

So my config line would look like:

ICON images/MailStatus_{node:this:state}.png

Am I correct in thinking this?
Yes, you would. The alternative is to use the numeric value, and an additional SCALE to change the colour of the label instead:

Code: Select all

SCALE cactiupdown 0 0.5  192 192 192
SCALE cactiupdown 0.5 1.5 255 0 0
SCALE cactiupdown 1.5 2.5 0 0 255
SCALE cactiupdown 2.5 3.5 0 255 0

NODE mynode
    TARGET cactihost:33
    USESCALE cactiupdown
    LABEL my node
    ICON images/myniceicon.png
    LABELOFFSET S
So the icon is the same, but the label will change colour with the state.

That's just off the top of my head, but it should work. The MAXVALUE for a NODE is 100 by default, so the percentage usages should match the states ( (1/100) * 100 = 1).
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
streaker69
Cacti Pro User
Posts: 712
Joined: Mon Mar 27, 2006 10:35 am
Location: Psychic Amish Network Administrator

Post by streaker69 »

Howie wrote:
streaker69 wrote:For those of us that are using custom graphics for our maps, wouldn't we have to create a custom status image for each graphic?

Like for mine, I'd have a MailStatus_up.png MailStatus_down.png MailStatus_disabled.png etc.

So my config line would look like:

ICON images/MailStatus_{node:this:state}.png

Am I correct in thinking this?
Yes, you would. The alternative is to use the numeric value, and an additional SCALE to change the colour of the label instead:

Code: Select all

SCALE cactiupdown 0 0.5  192 192 192
SCALE cactiupdown 0.5 1.5 255 0 0
SCALE cactiupdown 1.5 2.5 0 0 255
SCALE cactiupdown 2.5 3.5 0 255 0

NODE mynode
    TARGET cactihost:33
    USESCALE cactiupdown
    LABEL my node
    ICON images/myniceicon.png
    LABELOFFSET S
So the icon is the same, but the label will change colour with the state.

That's just off the top of my head, but it should work. The MAXVALUE for a NODE is 100 by default, so the percentage usages should match the states ( (1/100) * 100 = 1).
I just did the scale test and it works, at least it turned the background of the label text to green. So I'm assuming that the rest of it will work. Very cool feature.

I'll work on custom graphics of my map later and let you know, I did one host already. Basically just putting a circle on each image and then changing the color of it based upon the status. So each graphic will end up with four different versions.
cwahlin
Cacti User
Posts: 91
Joined: Fri Oct 10, 2003 7:23 am

Post by cwahlin »

Thanks Howie!

Works perfectly! :D

/Carl
User avatar
streaker69
Cacti Pro User
Posts: 712
Joined: Mon Mar 27, 2006 10:35 am
Location: Psychic Amish Network Administrator

Post by streaker69 »

I have one set of images completed, but I don't think things are working as expected. Here's what I'm getting in my log file:
03/29/2007 09:47:05 AM - WEATHERMAP: Poller[0] ICON images/emailstatus_[UNKNOWN].png does not exist, or is not readable. Check path and permissions.
Doesn't seem to be returning the state, here is my config section:
NODE node1170689558
LABEL MAIL
TARGET cactihost:31
ICON images/emailstatus_{node:this:state}.png
LABELOFFSET S
POSITION 334 550
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

streaker69 wrote: I'll work on custom graphics of my map later and let you know, I did one host already. Basically just putting a circle on each image and then changing the color of it based upon the status. So each graphic will end up with four different versions.
It's the sort of thing that something like Imagemagick would probably help with. Maybe make some overlay images as transparent PNGs with check marks or crosses or whatever, then overlay them on the 'master' icon to make a new set. Mac OS X does something similar to this, for some stuff.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
cwahlin
Cacti User
Posts: 91
Joined: Fri Oct 10, 2003 7:23 am

Post by cwahlin »

streaker69 wrote: I'll work on custom graphics of my map later and let you know, I did one host already. Basically just putting a circle on each image and then changing the color of it based upon the status. So each graphic will end up with four different versions.
All I did was change the color of the images I was using. I use the cisco PNGs I found on this forum. grey for disabled, green/yellow/red for states.

/Carl
User avatar
streaker69
Cacti Pro User
Posts: 712
Joined: Mon Mar 27, 2006 10:35 am
Location: Psychic Amish Network Administrator

Post by streaker69 »

cwahlin wrote:
streaker69 wrote: I'll work on custom graphics of my map later and let you know, I did one host already. Basically just putting a circle on each image and then changing the color of it based upon the status. So each graphic will end up with four different versions.
All I did was change the color of the images I was using. I use the cisco PNGs I found on this forum. grey for disabled, green/yellow/red for states.

/Carl
I'm doing pretty much the same thing, except I have different graphics for each server I monitor. It would appear though that for some reason, the State isn't being returned to weathermap. Not sure why.

Howie mentioned the Datasource plugin, which I believe was integrated into the Plugin Architecture, so I should be up to date on that.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

streaker69 wrote:Howie mentioned the Datasource plugin, which I believe was integrated into the Plugin Architecture, so I should be up to date on that.
Aaah. No. There's a plugin called Datasource? :roll:

Maybe I should rename some stuff in Weathermap then :-) I meant the weathermap-cactihost-datasource-plugin - Weathermap has plugins itself now, to make adding new data types easier. One of those is the one that lets you query the state of cacti hosts. You need a 0.9preX release to use it.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
streaker69
Cacti Pro User
Posts: 712
Joined: Mon Mar 27, 2006 10:35 am
Location: Psychic Amish Network Administrator

Post by streaker69 »

Howie wrote:
streaker69 wrote:Howie mentioned the Datasource plugin, which I believe was integrated into the Plugin Architecture, so I should be up to date on that.
Aaah. No. There's a plugin called Datasource? :roll:

Maybe I should rename some stuff in Weathermap then :-) I meant the weathermap-cactihost-datasource-plugin - Weathermap has plugins itself now, to make adding new data types easier. One of those is the one that lets you query the state of cacti hosts. You need a 0.9preX release to use it.
Ahh, ok, so where do I get weathermap-cactihost-datasource-plugin? I don't see it in the .9Pre1 release I have currently installed, and it isn't listed under downloads on your page.

Edit: nevermind, found that it's there, but doesn't seem to be working?
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

streaker69 wrote:Ahh, ok, so where do I get weathermap-cactihost-datasource-plugin? I don't see it in the .9Pre1 release I have currently installed, and it isn't listed under downloads on your page.
It should be in the lib/datasources/ directory... have I missed it off the packing list? You should have
./lib/datasources/WeatherMapDataSource_cactihost.php

It is loaded automatically, so any TARGET that begins cactihost: and then a number should just work for that host id.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
streaker69
Cacti Pro User
Posts: 712
Joined: Mon Mar 27, 2006 10:35 am
Location: Psychic Amish Network Administrator

Post by streaker69 »

Howie wrote:
streaker69 wrote:Ahh, ok, so where do I get weathermap-cactihost-datasource-plugin? I don't see it in the .9Pre1 release I have currently installed, and it isn't listed under downloads on your page.
It should be in the lib/datasources/ directory... have I missed it off the packing list? You should have
./lib/datasources/WeatherMapDataSource_cactihost.php

It is loaded automatically, so any TARGET that begins cactihost: and then a number should just work for that host id.
For some reason, it's just not getting the node state. Tried it a couple different ways, it's just not getting it.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

streaker69 wrote:For some reason, it's just not getting the node state. Tried it a couple different ways, it's just not getting it.
Hmm. anything useful in the DEBUG log?
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests