Cisco: start graphing UNshutdown'ed ports
Moderators: Developers, Moderators
Cisco: start graphing UNshutdown'ed ports
Hello everyone.
I'll try to describe the situation shortly:
I have lots of l BIG Cisco switches. However, only very few of the ports ar occupied. I want to monitor only active (up) ports in Cacti.
In order to do that I grate a device and upon graphing the interface stats I select which ports I want to graph. Seems to be pretty easy and nice... Until you UP some more ports in Cisco. I want to bypass the 'manual port graphing' and find some script.
The script would scan all hosts (all Cisco switches being monitored) nightly and add graphs for active ports (which do NOT have 'shutdown' line in them). Is there anything to do this task?
Thanks.
I'll try to describe the situation shortly:
I have lots of l BIG Cisco switches. However, only very few of the ports ar occupied. I want to monitor only active (up) ports in Cacti.
In order to do that I grate a device and upon graphing the interface stats I select which ports I want to graph. Seems to be pretty easy and nice... Until you UP some more ports in Cisco. I want to bypass the 'manual port graphing' and find some script.
The script would scan all hosts (all Cisco switches being monitored) nightly and add graphs for active ports (which do NOT have 'shutdown' line in them). Is there anything to do this task?
Thanks.
- phalek
- Developer
- Posts: 2838
- Joined: Thu Jan 31, 2008 6:39 am
- Location: Kressbronn, Germany
- Contact:
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
That might be true..
Quote of one of the first paragrahps of autom8 manual:
Quote of one of the first paragrahps of autom8 manual:
Of course, when creating a new device you will at least want to create all graphs related to
“Associated Graph Templatesâ€. But when it comes to Data Queries, it is not always desired to
create graphs for all indexes; e.g. you will not want to graph each and every interface, e.g. if it's
ifOperStatus is “downâ€. So you will make up your mind to restrict graph creation to “meaningfulâ€
indexes.
OK, I've successfully Installed the plugin but I'm not sure if this is really what I was looking for. Some help/advice required.
I need to do such a thing (rule in the plugin) so that when I reindex all my hosts (crontab, nightly) it would find the Cisco switches for "NOT administratively shutdown ('no shutdown') AND Link UP" ports and start graphing them. Any ideas how can I implement this?
I need to do such a thing (rule in the plugin) so that when I reindex all my hosts (crontab, nightly) it would find the Cisco switches for "NOT administratively shutdown ('no shutdown') AND Link UP" ports and start graphing them. Any ideas how can I implement this?
Nevermind, I've already made the proper rules.
Now I have some problem:
I've made a graph rule to match a host by regular expression and added "Rule Items => Create Graph":
However, when I do reindex all hosts, ALL graphs are being created, not just only new but also those old graphs being alredy graphed, are being re-created. If I rexindex hosts multiple times, then multiple dumplicate graphs are being created (see screenshots). That makes real mess. Is there any workaround for that?
Now I have some problem:
I've made a graph rule to match a host by regular expression and added "Rule Items => Create Graph":
Code: Select all
Item#1 1 ifOperStatus matches up Move DownMove Up Delete
Item#2 2 AND ifSpeed is greater than 0 Move DownMove Up Delete
Item#3 3 AND ifHwAddr is not empty Move DownMove Up Delete
Item#4 4 AND ifName matches regular expression (Fa[0-9]*|Gi[0-9]*)
- Attachments
-
- This is how my graphs for the host look after reindexing it for three times. Pay attention to TRIPLE graphs created!!
- Duplicates.png (200.75 KiB) Viewed 2732 times
-
- My Rules for this host
- Rules.png (168.89 KiB) Viewed 2732 times
OK, I've set my log level to DEVEL, then go to to Devices, select the device, click on the Reload green circle once. Then pressed Save, went to another window (Data Sources IIRC) just to get out of there. Then again, went back to Devices, selected device and pressed the Reload button once. After that I have duplicate graphs created for that device: three duplicates in total: one per interface as they were already there, one after the first 'Reload' and one more after the 2nd 'Reload'.
I've attached the log file. If you need any more information, please let me know.
PS: the host's in question ID is 27, it had 8 graphs and 8 data sources prior to creation. The Autom8 was expected to create one new graph for 'Fa 0/17' interface.
Also, there seemed to be error when I tried to 'Reload' and then 'Save' on the host. The errors were:
and one for line around 53. I solved them by adding this:
to functions "autom8_hook_data_query" and "autom8_hook_device_create_tree"
EDIT: Seems like I can't attach the log file so I've put it here: http://tss.vu.lt/logfile.log
Thanks.
I've attached the log file. If you need any more information, please let me know.
PS: the host's in question ID is 27, it had 8 graphs and 8 data sources prior to creation. The Autom8 was expected to create one new graph for 'Fa 0/17' interface.
Also, there seemed to be error when I tried to 'Reload' and then 'Save' on the host. The errors were:
Code: Select all
Fatal error: Call to undefined function autom8_log() in /var/www/cacti/plugins/autom8/autom8_functions.php on line 27
Code: Select all
include_once($config['base_path'] . "/plugins/autom8/autom8_utilities.php");
EDIT: Seems like I can't attach the log file so I've put it here: http://tss.vu.lt/logfile.log
Thanks.
I've relooked my cacti.log further and found some errors yesterday, just after I have installed and tested the plugin:
Hope it helps.
Code: Select all
03/25/2010 10:53:18 AM - SYSTEM STATS: Time:16.1098 Method:cmd.php Processes:8 Threads:N/A Hosts:44 HostsPerProcess:6 DataSources:1771 RRDsProcessed:1084
03/25/2010 10:53:18 AM - SYSTEM THOLD STATS: Time:0.0761 Tholds:60 Hosts:0
03/25/2010 10:53:22 AM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1054', SQL:"SELECT DISTINCT data_local.id FROM data_local LEFT JOIN data_template_data ON (data_local.id=data_template_data.local_data_id) LEFT JOIN data_input_data ON (data_template_data.id=data_input_data.data_template_data_id) LEFT JOIN data_input_fields ON (data_input_data.data_input_field_id=data_input_fields.id) LEFT JOIN snmp_query_graph ON (data_input_data.value=snmp_query_graph.id) WHERE data_input_fields.type_code=output_type AND snmp_query_graph.id=13 AND data_local.host_id=27 AND data_local.snmp_query_id=1 AND data_local.snmp_index='17'"
03/25/2010 10:53:22 AM - AUTOM8: Poller[0] Host[27] Graph Added - graph-id: (1971) - data-source-ids: (2252, 2252)
03/25/2010 10:53:22 AM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1054', SQL:"SELECT DISTINCT data_local.id FROM data_local LEFT JOIN data_template_data ON (data_local.id=data_template_data.local_data_id) LEFT JOIN data_input_data ON (data_template_data.id=data_input_data.data_template_data_id) LEFT JOIN data_input_fields ON (data_input_data.data_input_field_id=data_input_fields.id) LEFT JOIN snmp_query_graph ON (data_input_data.value=snmp_query_graph.id) WHERE data_input_fields.type_code=output_type AND snmp_query_graph.id=13 AND data_local.host_id=27 AND data_local.snmp_query_id=1 AND data_local.snmp_index='18'"
03/25/2010 10:53:22 AM - AUTOM8: Poller[0] Host[27] Graph Added - graph-id: (1972) - data-source-ids: (2253, 2253)
03/25/2010 10:53:22 AM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1054', SQL:"SELECT DISTINCT data_local.id FROM data_local LEFT JOIN data_template_data ON (data_local.id=data_template_data.local_data_id) LEFT JOIN data_input_data ON (data_template_data.id=data_input_data.data_template_data_id) LEFT JOIN data_input_fields ON (data_input_data.data_input_field_id=data_input_fields.id) LEFT JOIN snmp_query_graph ON (data_input_data.value=snmp_query_graph.id) WHERE data_input_fields.type_code=output_type AND snmp_query_graph.id=13 AND data_local.host_id=27 AND data_local.snmp_query_id=1 AND data_local.snmp_index='19'"
03/25/2010 10:53:22 AM - AUTOM8: Poller[0] Host[27] Graph Added - graph-id: (1973) - data-source-ids: (2254, 2254)
03/25/2010 10:53:22 AM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1054', SQL:"SELECT DISTINCT data_local.id FROM data_local LEFT JOIN data_template_data ON (data_local.id=data_template_data.local_data_id) LEFT JOIN data_input_data ON (data_template_data.id=data_input_data.data_template_data_id) LEFT JOIN data_input_fields ON (data_input_data.data_input_field_id=data_input_fields.id) LEFT JOIN snmp_query_graph ON (data_input_data.value=snmp_query_graph.id) WHERE data_input_fields.type_code=output_type AND snmp_query_graph.id=13 AND data_local.host_id=27 AND data_local.snmp_query_id=1 AND data_local.snmp_index='20'"
03/25/2010 10:53:22 AM - AUTOM8: Poller[0] Host[27] Graph Added - graph-id: (1974) - data-source-ids: (2255, 2255)
03/25/2010 10:53:22 AM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1054', SQL:"SELECT DISTINCT data_local.id FROM data_local LEFT JOIN data_template_data ON (data_local.id=data_template_data.local_data_id) LEFT JOIN data_input_data ON (data_template_data.id=data_input_data.data_template_data_id) LEFT JOIN data_input_fields ON (data_input_data.data_input_field_id=data_input_fields.id) LEFT JOIN snmp_query_graph ON (data_input_data.value=snmp_query_graph.id) WHERE data_input_fields.type_code=output_type AND snmp_query_graph.id=13 AND data_local.host_id=27 AND data_local.snmp_query_id=1 AND data_local.snmp_index='21'"
03/25/2010 10:53:22 AM - AUTOM8: Poller[0] Host[27] Graph Added - graph-id: (1975) - data-source-ids: (2256, 2256)
03/25/2010 10:53:22 AM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1054', SQL:"SELECT DISTINCT data_local.id FROM data_local LEFT JOIN data_template_data ON (data_local.id=data_template_data.local_data_id) LEFT JOIN data_input_data ON (data_template_data.id=data_input_data.data_template_data_id) LEFT JOIN data_input_fields ON (data_input_data.data_input_field_id=data_input_fields.id) LEFT JOIN snmp_query_graph ON (data_input_data.value=snmp_query_graph.id) WHERE data_input_fields.type_code=output_type AND snmp_query_graph.id=13 AND data_local.host_id=27 AND data_local.snmp_query_id=1 AND data_local.snmp_index='22'"
03/25/2010 10:53:22 AM - AUTOM8: Poller[0] Host[27] Graph Added - graph-id: (1976) - data-source-ids: (2257, 2257)
03/25/2010 10:53:22 AM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1054', SQL:"SELECT DISTINCT data_local.id FROM data_local LEFT JOIN data_template_data ON (data_local.id=data_template_data.local_data_id) LEFT JOIN data_input_data ON (data_template_data.id=data_input_data.data_template_data_id) LEFT JOIN data_input_fields ON (data_input_data.data_input_field_id=data_input_fields.id) LEFT JOIN snmp_query_graph ON (data_input_data.value=snmp_query_graph.id) WHERE data_input_fields.type_code=output_type AND snmp_query_graph.id=13 AND data_local.host_id=27 AND data_local.snmp_query_id=1 AND data_local.snmp_index='23'"
03/25/2010 10:53:22 AM - AUTOM8: Poller[0] Host[27] Graph Added - graph-id: (1977) - data-source-ids: (2258, 2258)
03/25/2010 10:53:22 AM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1054', SQL:"SELECT DISTINCT data_local.id FROM data_local LEFT JOIN data_template_data ON (data_local.id=data_template_data.local_data_id) LEFT JOIN data_input_data ON (data_template_data.id=data_input_data.data_template_data_id) LEFT JOIN data_input_fields ON (data_input_data.data_input_field_id=data_input_fields.id) LEFT JOIN snmp_query_graph ON (data_input_data.value=snmp_query_graph.id) WHERE data_input_fields.type_code=output_type AND snmp_query_graph.id=13 AND data_local.host_id=27 AND data_local.snmp_query_id=1 AND data_local.snmp_index='24'"
03/25/2010 10:53:22 AM - AUTOM8: Poller[0] Host[27] Graph Added - graph-id: (1978) - data-source-ids: (2259, 2259)
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
This looks like the problem:
Gandalf,
You need to jazz that interface up too
Nice plugin BTW
TheWitness
Code: Select all
WHERE data_input_fields.type_code=output_type
You need to jazz that interface up too
Nice plugin BTW
TheWitness
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
That was fixed some time ago. V0.33 is clean (at least for that SQL)TheWitness wrote:This looks like the problem:
Code: Select all
WHERE data_input_fields.type_code=output_type
You make meYou need to jazz that interface up too
Suggestions?
Nice plugin BTW
R.
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
You know I was kidding rightgandalf wrote:That was fixed some time ago. V0.33 is clean (at least for that SQL)TheWitness wrote:This looks like the problem:
Code: Select all
WHERE data_input_fields.type_code=output_type
You make meYou need to jazz that interface up too
Suggestions?
Nice plugin BTW
R.
TheWitness
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Who is online
Users browsing this forum: No registered users and 5 guests