|
|
| Author |
Message |
cwahlin Cacti User
Joined: 10 Oct 2003 Posts: 87
|
Posted: Thu Mar 29, 2007 5:52 am Post subject: host monitoring? |
|
|
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
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 |
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 1958 Location: United Kingdom
|
Posted: Thu Mar 29, 2007 7:45 am Post subject: Re: host monitoring? |
|
|
| 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
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: |
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  |
|
| Back to top |
|
 |
streaker69 Cacti Pro User
Joined: 27 Mar 2006 Posts: 626 Location: Psychic Amish Network Administrator
|
Posted: Thu Mar 29, 2007 7:47 am Post subject: |
|
|
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? |
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 1958 Location: United Kingdom
|
Posted: Thu Mar 29, 2007 8:01 am Post subject: |
|
|
| 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: |
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). |
|
| Back to top |
|
 |
streaker69 Cacti Pro User
Joined: 27 Mar 2006 Posts: 626 Location: Psychic Amish Network Administrator
|
Posted: Thu Mar 29, 2007 8:11 am Post subject: |
|
|
| 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: |
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. |
|
| Back to top |
|
 |
cwahlin Cacti User
Joined: 10 Oct 2003 Posts: 87
|
Posted: Thu Mar 29, 2007 8:50 am Post subject: |
|
|
Thanks Howie!
Works perfectly!
/Carl |
|
| Back to top |
|
 |
streaker69 Cacti Pro User
Joined: 27 Mar 2006 Posts: 626 Location: Psychic Amish Network Administrator
|
Posted: Thu Mar 29, 2007 8:50 am Post subject: |
|
|
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:
| Quote: |
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:
| Quote: |
NODE node1170689558
LABEL MAIL
TARGET cactihost:31
ICON images/emailstatus_{node:this:state}.png
LABELOFFSET S
POSITION 334 550
|
|
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 1958 Location: United Kingdom
|
Posted: Thu Mar 29, 2007 9:01 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
cwahlin Cacti User
Joined: 10 Oct 2003 Posts: 87
|
Posted: Thu Mar 29, 2007 9:08 am Post subject: |
|
|
| 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 |
|
| Back to top |
|
 |
streaker69 Cacti Pro User
Joined: 27 Mar 2006 Posts: 626 Location: Psychic Amish Network Administrator
|
Posted: Thu Mar 29, 2007 9:12 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 1958 Location: United Kingdom
|
Posted: Thu Mar 29, 2007 9:19 am Post subject: |
|
|
| 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?
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. |
|
| Back to top |
|
 |
streaker69 Cacti Pro User
Joined: 27 Mar 2006 Posts: 626 Location: Psychic Amish Network Administrator
|
Posted: Thu Mar 29, 2007 9:37 am Post subject: |
|
|
| 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?
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? |
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 1958 Location: United Kingdom
|
Posted: Thu Mar 29, 2007 9:44 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
streaker69 Cacti Pro User
Joined: 27 Mar 2006 Posts: 626 Location: Psychic Amish Network Administrator
|
Posted: Thu Mar 29, 2007 9:55 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 1958 Location: United Kingdom
|
Posted: Thu Mar 29, 2007 10:24 am Post subject: |
|
|
| 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? |
|
| Back to top |
|
 |
|