Popup with snmp device info in weathermap

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

brightm
Cacti User
Posts: 88
Joined: Wed Jun 16, 2010 6:20 am
Location: Bournemouth UK

Post by brightm »

Hi,

I'm trying to get this working with the least amount of typing in the config files. Is it possible to have the following lines under NODE DEFAULT:

NODE DEFAULT
NOTES <iframe width=\"400px\" height=\"400px\" src=\"/cacti/plugins/weathermap/info.php?node={node:this:cacti_host_id}\"> </iframe>
LABELOFFSET S
LABELFONT 101
MAXVALUE 100

This would include: SET rrd_use_poller_output 1 being set at the top of the config file.

The posts indicate that the variable 'cacti_host_id' will be automatically set by Cacti/Weathermap. So am i missing anything or is it necessary to add
the NOTES command to each NODE definition?

Versions:
Weathermap 0.97
Cacti: 0.8.7g

Any help would be appreciated.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

That looks like it should work fine. What is going wrong?
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!)
sukanta
Cacti User
Posts: 139
Joined: Tue Jan 26, 2010 6:12 am

Post by sukanta »

How to make the NOTE text font smaller??
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

sukanta wrote:How to make the NOTE text font smaller??
It's HTML. Add <font size=2> and </font> tags around 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!)
brightm
Cacti User
Posts: 88
Joined: Wed Jun 16, 2010 6:20 am
Location: Bournemouth UK

Post by brightm »

brightm wrote:Hi,

I'm trying to get this working with the least amount of typing in the config files. Is it possible to have the following lines under NODE DEFAULT:

NODE DEFAULT
NOTES <iframe width="400px" height="400px" src="/cacti/plugins/weathermap/info.php?node={node:this:cacti_host_id}"> </iframe>
LABELOFFSET S
LABELFONT 101
MAXVALUE 100

This would include: SET rrd_use_poller_output 1 being set at the top of the config file.

The posts indicate that the variable 'cacti_host_id' will be automatically set by Cacti/Weathermap. So am i missing anything or is it necessary to add
the NOTES command to each NODE definition?

Versions:
Weathermap 0.97
Cacti: 0.8.7g

Any help would be appreciated.
Does this require you to add "SET cacti_host_id xx" to each NODE definition or is it using a hint variable? Thanks.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

brightm wrote:
Does this require you to add "SET cacti_host_id xx" to each NODE definition or is it using a hint variable? Thanks.
As long as you have
SET rrd_use_poller_output 1
then Weathermap will pull the correct information out of the host_snmp_cache table in the Cacti database.
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!)
brightm
Cacti User
Posts: 88
Joined: Wed Jun 16, 2010 6:20 am
Location: Bournemouth UK

Post by brightm »

Thanks Howie.

I tried adding the line:

"NOTES <iframe width=\"400px\" height=\"400px\" src=\"/cacti/plugins/weathermap/info.php?node={node:this:cacti_host_id}\"> </iframe"

Also added:

SET rrd_use_poller_output 1

to the top of the config file and the whole system is running like a dog now. The mysqld process is running a very high cpu - 100%. Any ideas?
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Aha... welcome to Issue with weathermap and boost.

Try this:

In lib/ds-common.php, change the SQL line near the top.

Code: Select all

"select data_local.host_id, field_name,field_value from data_local,host_snmp_cache  USE INDEX (PRIMARY) where data_local.id=%d and data_local.host_id=host_snmp_cache.host_id and data_local.snmp_index=host_snmp_cache.snmp_index and data_local.snmp_query_id=host_snmp_cache.snmp_query_id",
So that's adding "USE INDEX (PRIMARY) " after the host_snmp_cache.
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!)
brightm
Cacti User
Posts: 88
Joined: Wed Jun 16, 2010 6:20 am
Location: Bournemouth UK

Post by brightm »

Do i need boost installed?

Whether i do or not, that has fixed the problem with cpu! Thanks alot, much appreciated!
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

brightm wrote:Do i need boost installed?

Whether i do or not, that has fixed the problem with cpu! Thanks alot, much appreciated!
Cool - I still don't know why MySQL doesn't pick the right index by itself. That fix and another optimisation to cache database queries will be in 0.98.

No - you don't need Boost installed to use poller_output. But if you DO have Boost installed, then you MUST use poller_output, because the rrd files aren't updated every cycle.
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!)
brightm
Cacti User
Posts: 88
Joined: Wed Jun 16, 2010 6:20 am
Location: Bournemouth UK

Post by brightm »

Maybe it's a 'feature' of mysql!?

snmp pop doesn't seem to work - i get 'SNMP not in use'.
In the cacti log there are errors:


07/16/2010 04:53:44 PM - CMDPHP: Poller[0] ERROR: SQL Row Failed!, Error:'1064', SQL:"select * from host where id=[UNKNOWN]"

Err not sure. I have attached my weathermap config file. Originally i used SET cacti_id xx to get this working which is now superseded by:

NOTES <iframe width=\"400px\" height=\"400px\" src=\"/cacti/plugins/weathermap/info.php?node={node:this:cacti_host_id}\"> </iframe>

in the NODE default section.

Have i missed anything?
[/list]
Attachments
Town Hall.txt
(15.37 KiB) Downloaded 232 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

None of your nodes have a target.

It only sets the cacti_host_id as a side effect of collecting data for a regular rrd target. So you need to either add a target for each node, OR change the {} part in NOTES to something like {link:BBC-10.10.121.2-Passport2:cacti_host_id}

Where BBC-10.10.121.2-Passport2 is a link which has it's 'a' end on that node. Because the links DO have a target, they DO have cacti_host_id defined already.
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!)
brightm
Cacti User
Posts: 88
Joined: Wed Jun 16, 2010 6:20 am
Location: Bournemouth UK

Post by brightm »

Ah I remember reading some stuff on target this morning but forgot to try it out. Thanks I'll give that ago and see what happens.
brightm
Cacti User
Posts: 88
Joined: Wed Jun 16, 2010 6:20 am
Location: Bournemouth UK

Post by brightm »

Hi Howie,

Sorry to be a thickie but just wondered if you could explain why the following 2 examples do not work:

EXample 1

TEMPLATE-only NODEs:
NODE DEFAULT
TARGET cactimonitor:cacti_id
NOTES <iframe width=\"400px\" height=\"400px\" src=\"/cacti/plugins/weathermap/info.php?node={node:this:cacti_host_id}\"> </iframe>
LABELOFFSET S
LABELFONT 101
MAXVALUE 100


# regular NODEs:
NODE Passport1
LABEL Passport 1
LABELOFFSET N
ICON images/Passport1.PNG
POSITION 275 468
SET cacti_id 2
****************************************************************************************************************

Example 2

NODE DEFAULT
TARGET cactimonitor:{node:this:host_id}
NOTES <iframe width=\"400px\" height=\"400px\" src=\"/cacti/plugins/weathermap/info.php?node={node:this:cacti_host_id}\"> </iframe>
LABELOFFSET S
LABELFONT 101
MAXVALUE 100


## regular NODEs:
NODE Passport2
LABEL Passport 1
LABELOFFSET N
ICON images/Passport2.PNG
POSITION 275 468



What does work:


NODE DEFAULT
NOTES <iframe width=\"400px\" height=\"400px\" src=\"/cacti/plugins/weathermap/info.php?node={node:this:cacti_id}\"> </iframe>
LABELOFFSET S
LABELFONT 101
MAXVALUE 100


# regular NODEs:
NODE Passport1
LABEL Passport 1
LABELOFFSET N
ICON images/Passport1.PNG
POSITION 275 468
SET cacti_id 2
TARGET cactimonitor:2


I was hoping to use the cactimonitor:hostid command in the default node configuration as well as the NOTES command. If i follow the example you have given me I would need to add the TARGET command to each node, so i may just as well use the SET cacti_id # command for each node in combination with the NOTES command in the dafault node.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

The first example would work if you used cactimonitor:{node:this:cacti_id} instead.

The second example would work if you actually defined host_id in the node.
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