Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


host monitoring?
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cacti Forum Index -> Plugin: (Network Weather Map)
Author Message
streaker69
Cacti Pro User


Joined: 27 Mar 2006
Posts: 647
Location: Psychic Amish Network Administrator

PostPosted: Thu Mar 29, 2007 10:42 am    Post subject: Reply with quote

Howie wrote:
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?


Here's the excerpt from the debug for the node I'm working with.

Quote:

ReadData for NODE node1144211361:
03/29/2007 11:32:22 AM - WEATHERMAP: Poller[0] ReadData: New Target: cactihost:7
03/29/2007 11:32:22 AM - WEATHERMAP: Poller[0] ReadData: Matched for WeatherMapDataSource_cactihost. Calling WeatherMapDataSource_cactihost->ReadData()
03/29/2007 11:32:22 AM - WEATHERMAP: Poller[0] CactiHost ReadData: Returning (3,3,0)
03/29/2007 11:32:22 AM - WEATHERMAP: Poller[0] ReadData: Setting 3,3
03/29/2007 11:32:22 AM - WEATHERMAP: Poller[0]


And then further down in the debug:

Quote:

03/29/2007 11:32:23 AM - WEATHERMAP: Poller[0] ICON images/emailstatus_[UNKNOWN].png does not exist, or is not readable. Check path and permissions.


I keep getting the [UKNOWN] wherever I put the {node:this:state}. I found you can put that on the label line as well, just as a quick debug to see what value it's getting and it always comes up as [UNKNOWN].
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 2059
Location: United Kingdom

PostPosted: Thu Mar 29, 2007 10:50 am    Post subject: Reply with quote

streaker69 wrote:

I keep getting the [UKNOWN] wherever I put the {node:this:state}. I found you can put that on the label line as well, just as a quick debug to see what value it's getting and it always comes up as [UNKNOWN].


And if you put {node:this:bandwidth_in} in your label? You should get 3...
Back to top
streaker69
Cacti Pro User


Joined: 27 Mar 2006
Posts: 647
Location: Psychic Amish Network Administrator

PostPosted: Thu Mar 29, 2007 10:54 am    Post subject: Reply with quote

Howie wrote:
streaker69 wrote:

I keep getting the [UKNOWN] wherever I put the {node:this:state}. I found you can put that on the label line as well, just as a quick debug to see what value it's getting and it always comes up as [UNKNOWN].


And if you put {node:this:bandwidth_in} in your label? You should get 3...


Yes, I did, so that part works.

Ok, after reading through your source for WeatherMapPlugin_cactihost.php, I think the problem is in there. But I'm kind of fumbling through it because I really don't php that well.

I'll show you what I've changed, which does return a value, but I'm still getting [UNKNOWN].

Code:

                $inbw = $state;
                $outbw = $state;
                $item->add_note("state",$statename);
            }
        }
 
        debug ("CactiHost ReadData: Returning ($inbw,$outbw,$state)\n");
 
        return( array($inbw, $outbw, $state));
    }
}


You did have $date_time where I now have $state. If I put $statename there then the debug does show 'up' for the status, but it isn't outputing that with the {node:this:state}.
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 2059
Location: United Kingdom

PostPosted: Thu Mar 29, 2007 11:33 am    Post subject: Reply with quote

streaker69 wrote:

You did have $date_time where I now have $state. If I put $statename there then the debug does show 'up' for the status, but it isn't outputing that with the {node:this:state}.


No, that last return value should be $date_time... all the plugins return the 'age' of their data, so that it can be displayed in the map by some non-existent-yet part. The theory was that if your collector has died, you want that to show somehow in the map, so you aren't happily looking at 3 hour old data while your datacentre is on fire. This is what the post-processing plugins were intended for, although I haven't really crystalised how that should work yet.

Are you using PHP4 by any chance?

For the moment, the obvious fix is to use bandwidth_in instead of state, and put the numbers in your filenames instead of the names, but that doesn't fix the add_note() stuff.
Back to top
streaker69
Cacti Pro User


Joined: 27 Mar 2006
Posts: 647
Location: Psychic Amish Network Administrator

PostPosted: Thu Mar 29, 2007 11:35 am    Post subject: Reply with quote

Howie wrote:
streaker69 wrote:

You did have $date_time where I now have $state. If I put $statename there then the debug does show 'up' for the status, but it isn't outputing that with the {node:this:state}.


No, that last return value should be $date_time... all the plugins return the 'age' of their data, so that it can be displayed in the map by some non-existent-yet part. The theory was that if your collector has died, you want that to show somehow in the map, so you aren't happily looking at 3 hour old data while your datacentre is on fire. This is what the post-processing plugins were intended for, although I haven't really crystalised how that should work yet.

Are you using PHP4 by any chance?

For the moment, the obvious fix is to use bandwidth_in instead of state, and put the numbers in your filenames instead of the names, but that doesn't fix the add_note() stuff.


I'll put the $date_time back in. And I just did exactly what you said before you posted this and it's working. Apparently the StateName portion isn't working right. I am using PHP 4.3.9. I'm ok using the numeric values, easy enough to do.
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 2059
Location: United Kingdom

PostPosted: Thu Mar 29, 2007 11:48 am    Post subject: Reply with quote

streaker69 wrote:
I'll put the $date_time back in. And I just did exactly what you said before you posted this and it's working. Apparently the StateName portion isn't working right. I am using PHP 4.3.9. I'm ok using the numeric values, easy enough to do.


OK. Then it's a PHP4 vs PHP5 problem. I wish PHP4 would die quickly.

It'll be fixed in the next version.
Back to top
streaker69
Cacti Pro User


Joined: 27 Mar 2006
Posts: 647
Location: Psychic Amish Network Administrator

PostPosted: Thu Mar 29, 2007 11:51 am    Post subject: Reply with quote

Howie wrote:
streaker69 wrote:
I'll put the $date_time back in. And I just did exactly what you said before you posted this and it's working. Apparently the StateName portion isn't working right. I am using PHP 4.3.9. I'm ok using the numeric values, easy enough to do.


OK. Then it's a PHP4 vs PHP5 problem. I wish PHP4 would die quickly.

It'll be fixed in the next version.


Ok, so should I upgrade to PHP5? All this box does is run Cacti, and it's a default installation from the CactiEZ ISO.
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 2059
Location: United Kingdom

PostPosted: Thu Mar 29, 2007 12:09 pm    Post subject: Reply with quote

streaker69 wrote:
Howie wrote:
streaker69 wrote:
I'll put the $date_time back in. And I just did exactly what you said before you posted this and it's working. Apparently the StateName portion isn't working right. I am using PHP 4.3.9. I'm ok using the numeric values, easy enough to do.


OK. Then it's a PHP4 vs PHP5 problem. I wish PHP4 would die quickly.

It'll be fixed in the next version.


Ok, so should I upgrade to PHP5? All this box does is run Cacti, and it's a default installation from the CactiEZ ISO.


Nah, if you have a quick fix in place already, stick with that. I'll work around PHP4 for the next version. There are dozens of little PHP4 bodges in there already.
Back to top
streaker69
Cacti Pro User


Joined: 27 Mar 2006
Posts: 647
Location: Psychic Amish Network Administrator

PostPosted: Thu Mar 29, 2007 6:32 pm    Post subject: Reply with quote

Just thought I'd point it out in case it wasn't obvious, but you can put the USESCALE cactiupdown from Howie's previous example in the Node Default section of your config file. Saves from having to type it in on every single node.
Back to top
joez



Joined: 11 Feb 2008
Posts: 34

PostPosted: Fri Apr 18, 2008 6:47 am    Post subject: Reply with quote

Ok so I can read the status of a device and have different pictures and colors set depending on the status.

Does this also work for single ports on a device?

Thanks
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 2059
Location: United Kingdom

PostPosted: Fri Apr 18, 2008 6:51 am    Post subject: Reply with quote

joez wrote:
Ok so I can read the status of a device and have different pictures and colors set depending on the status.

Does this also work for single ports on a device?

Thanks


Do you have some datasource that contains the status of the ports?
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 2059
Location: United Kingdom

PostPosted: Sun Apr 27, 2008 9:49 am    Post subject: Reply with quote

In 0.96, if you use the poller_output option, then the RRD datasource plugin will collect all the information that Cacti knows about the interface too.

Basically anything that you can say |query_blah| in a Cacti graph title, will be defined as a variable so you can use {link:this:cacti_blah} in weathermap. For the Interface Traffic template, that includes: ifOperStatus (up/down), ifSpeed, ifAlias/ifDescr (the router's name for the interface), and ifIP.

I'm just adding this in at the moment, but it'll be in the next release. I think there will be a test version in a 2-3 weeks, at the moment. At that stage you would be able to use the ifOperStatus in the ICON filename for an interface. I'll try and get an example together when the test release is ready.
Back to top
Lemmy78



Joined: 04 Apr 2006
Posts: 25

PostPosted: Thu Jun 12, 2008 5:00 am    Post subject: Reply with quote

Hi guys,

I just read the topic about the display icon depending of the host status.

I've also have the ICON images\router_{UNKOWN}.png error.

I'm running cacti 0.87a with weathermap 0.94.

I tried a lot of changes without success. I stil have the message.

Any help would be appreciated


Thanks


Regards
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 2059
Location: United Kingdom

PostPosted: Thu Jun 12, 2008 6:32 am    Post subject: Reply with quote

Lemmy78 wrote:
Hi guys,

I just read the topic about the display icon depending of the host status.

I've also have the ICON images\router_{UNKOWN}.png error.

I'm running cacti 0.87a with weathermap 0.94.

I tried a lot of changes without success. I stil have the message.

Any help would be appreciated


You are more likely to get help if you said:
* what your config looks like
* what you tried

The [UNKNOWN] means that the {} variable you are using isn't defined. Post your config.
Back to top
Lemmy78



Joined: 04 Apr 2006
Posts: 25

PostPosted: Thu Jun 12, 2008 7:16 am    Post subject: Reply with quote

My config

Quote:

NODE node05521
TARGET cactihost:154
USESCALE non
LABEL mylabel
INFOURL https://url
OVERLIBGRAPH https://url
ICON images/router_{node:this:state}.png
LABELOFFSET 0 22
POSITION 900 420


Reading the post, I've tried to replace state with banwidth_in and I get value "3".
I'm using PHP 5.2.1.

Do you need more ?

Thanks[/quote]
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Plugin: (Network Weather Map) All times are GMT - 5 Hours
Goto page Previous  1, 2
Page 2 of 2

 



Powered by phpBB © 2001, 2005 phpBB Group