lcano Cacti User
Joined: 09 Oct 2008 Posts: 121 Location: Spain
|
Posted: Thu May 27, 2010 5:27 am Post subject: How to get the URL of any interface graph in cacti |
|
|
I sometimes need to know the specific URL of any graph interface for several reasons. May be nobody else had this needed before, or probably nobody thought about it. In my case, I had some different network maps (home made network maps, not weather maps), where I had to link the traffic for each interface.
Even, this script allows you to use that URLs for external use, not associated with cacti.
I'm not sure if somebody else can be interested, but once I had it, I think it's a good idea to share with all of you. Who knows if in the future is useful.
An example:
I have one device named: menp1x1.wnet
This device has several FastEthernet interfaces.
Let's say I need to know the URL associated to the graph which shows the traffic of interface FastEthernet1/9/1 in that device. This script allows you to get it automaticaly only with the hostname and the if_name.
Format: ./get_cacti_graph.sh <hostname> <if_name>
$ ./get_cacti_graph.sh menp1x1.wnet Fa1/0/1
Host Name=menp1x1.wnet|Host ID=4|IFace Index=10001|Graph ID=64
URL = http://127.0.0.1/cacti/graph.php?local_graph_id=64
The script is a really simple query to the mysql database to get the needed info.
The script is running in Linux 2.6.
| Description: |
|
 Download |
| Filename: |
get_cacti_graph.sh |
| Filesize: |
1.54 KB |
| Downloaded: |
32 Time(s) |
|
|