Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Mon Aug 21, 2017 7:01 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 49 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: host monitoring?
PostPosted: Thu Mar 29, 2007 5:52 am 
Offline
Cacti User

Joined: Fri Oct 10, 2003 7:23 am
Posts: 91
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


Top
 Profile  
 
 Post subject: Re: host monitoring?
PostPosted: Thu Mar 29, 2007 7:45 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5118
Location: United Kingdom
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:
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.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 29, 2007 7:47 am 
Offline
Cacti Pro User
User avatar

Joined: Mon Mar 27, 2006 10:35 am
Posts: 711
Location: Psychic Amish Network Administrator
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?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 29, 2007 8:01 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5118
Location: United Kingdom
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).

_________________
Weathermap 0.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 29, 2007 8:11 am 
Offline
Cacti Pro User
User avatar

Joined: Mon Mar 27, 2006 10:35 am
Posts: 711
Location: Psychic Amish Network Administrator
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.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 29, 2007 8:50 am 
Offline
Cacti User

Joined: Fri Oct 10, 2003 7:23 am
Posts: 91
Thanks Howie!

Works perfectly! :D

/Carl


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 29, 2007 8:50 am 
Offline
Cacti Pro User
User avatar

Joined: Mon Mar 27, 2006 10:35 am
Posts: 711
Location: Psychic Amish Network Administrator
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 29, 2007 9:01 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5118
Location: United Kingdom
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.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 29, 2007 9:08 am 
Offline
Cacti User

Joined: Fri Oct 10, 2003 7:23 am
Posts: 91
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 29, 2007 9:12 am 
Offline
Cacti Pro User
User avatar

Joined: Mon Mar 27, 2006 10:35 am
Posts: 711
Location: Psychic Amish Network Administrator
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.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 29, 2007 9:19 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5118
Location: United Kingdom
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.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 29, 2007 9:37 am 
Offline
Cacti Pro User
User avatar

Joined: Mon Mar 27, 2006 10:35 am
Posts: 711
Location: Psychic Amish Network Administrator
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?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 29, 2007 9:44 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5118
Location: United Kingdom
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.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 29, 2007 9:55 am 
Offline
Cacti Pro User
User avatar

Joined: Mon Mar 27, 2006 10:35 am
Posts: 711
Location: Psychic Amish Network Administrator
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.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 29, 2007 10:24 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5118
Location: United Kingdom
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.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 49 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: TinusTuinslang and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group