Cacti-Weathermap-Export

Support questions about the Network Weather Map plugin

Moderators: Moderators, Developers

Post Reply
Author
Message
pradeeps
Posts: 9
Joined: Tue Apr 23, 2019 7:56 am

Cacti-Weathermap-Export

#1 Post by pradeeps » Tue Jun 11, 2019 2:45 pm

Hello Folks,
I would like to know if there is an option in cacti to export the weathermap (in html,csv,..etc) to list the graph IDs associated to it.

Code: Select all

Date 	Tue, 11 Jun 2019 19:44:35 +0000
Cacti Version 	0.8.8h
Cacti OS 	unix
SNMP Version 	NET-SNMP version: 5.7.2
RRDTool Version 	RRDTool 1.4.x
Hosts 	7540
Graphs 	75240
Data Sources 	Script/Command: 8681
SNMP: 70249
SNMP Query: 29930
Script Query: 3
Script - Script Server (PHP): 18
Total: 108881

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

Re: Cacti-Weathermap-Export

#2 Post by Howie » Sat Jun 22, 2019 7:21 am

1) Weathermap reads data sources, not graphs. (there is not a 1:1 mapping between the two - you can have a graph aggregating multiple data sources in Cacti, or two graphs showing the same data source in different presentations, or with different CDEFs)

2) It only reads what you tell it to. i.e. You already know :-) "grep TARGET weathermap.conf" will tell you the involved rrd files, if that's what you are using (it's only one option of several). The filename usually will tell you the datasource ID, depending on how you configured Cacti.

I think maybe I'm missing the point... what's the application for this exported information?
Weathermap 0.98 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!)

pradeeps
Posts: 9
Joined: Tue Apr 23, 2019 7:56 am

Re: Cacti-Weathermap-Export

#3 Post by pradeeps » Mon Jun 24, 2019 9:27 am

The applications for the graphs id are it is fed into another script which is used to pull the traffic rate which eventually used for KPI.Saying that I have looked into the weather-map configs for the rrd files involved where i can get the graphs UID as-well. However, if its not too much asking, is there a way to get the graphs name associated with the UIDs?

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

Re: Cacti-Weathermap-Export

#4 Post by Howie » Mon Jun 24, 2019 9:41 am

No, you get Data Source IDs. Those are not the same. (But probably they ARE what you want for your other script - the graph ID is mainly useful for building a URL to show the graph, not so much for getting actual numbers).

If you really really want graph IDs (I still think you don't). There is some code in the weathermap random-bits/cacti-integrate.php script. That is basically the same as what the editor picker uses to find a graph related to a data source.

You might also want to look at the DATAOUTPUTFILE directive. Or look in the weathermap/output directory for the data files that Weathermap already saves, if all you need is the current value (the file named XXXXX.results.txt for each map).
Weathermap 0.98 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!)

pradeeps
Posts: 9
Joined: Tue Apr 23, 2019 7:56 am

Re: Cacti-Weathermap-Export

#5 Post by pradeeps » Mon Jun 24, 2019 9:59 am

Thank you. I will certainly check your suggestions. Just to be clear, incase if my reference name is misleading, I am looking the get the "graph_id" circled in the screenshot.In our current setup, to get the graph_id, we need to click each link in the weathermap manually which opens up a graph url with an id at the end.To avoid the manual process, I am trying to get it is as a report from weathermap itself . Please dont mind if my explanation looks silly.
Capture.JPG
Capture.JPG (14.41 KiB) Viewed 467 times

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

Re: Cacti-Weathermap-Export

#6 Post by Howie » Mon Jun 24, 2019 12:09 pm

I still don't think that will get you traffic numbers from Cacti, but if you are doing this by clicking on links in weathermap, just do this instead:

Code: Select all

 awk  'BEGIN {FS="=" } /INFOURL/ {print $NF;}' < weathermap.conf > export.txt
Weathermap 0.98 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!)

pradeeps
Posts: 9
Joined: Tue Apr 23, 2019 7:56 am

Re: Cacti-Weathermap-Export

#7 Post by pradeeps » Mon Jun 24, 2019 2:06 pm

Awesome Thanks. That works.

Post Reply