Cisco: start graphing UNshutdown'ed ports

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
hid3
Cacti User
Posts: 63
Joined: Sat Jun 14, 2008 1:59 am

Cisco: start graphing UNshutdown'ed ports

Post by hid3 »

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.
User avatar
Sirup
Cacti Moderator
Posts: 348
Joined: Tue Mar 02, 2010 9:03 am

Post by Sirup »

I also would need some information on that problem.
Its pretty frustrating when you have tons of switchports and manually deselect the shut ones.
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

not sure, but Autom8 may be a good help in doing this ?

http://docs.cacti.net/plugin:autom8
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
User avatar
Sirup
Cacti Moderator
Posts: 348
Joined: Tue Mar 02, 2010 9:03 am

Post by Sirup »

That might be true..
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.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

I love people advertising my plugins :oops:
R.
hid3
Cacti User
Posts: 63
Joined: Sat Jun 14, 2008 1:59 am

Post by hid3 »

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?
hid3
Cacti User
Posts: 63
Joined: Sat Jun 14, 2008 1:59 am

Post by hid3 »

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":

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]*)
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?
Attachments
This is how my graphs for the host look after reindexing it for three times. Pay attention to TRIPLE graphs created!!
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
My Rules for this host
Rules.png (168.89 KiB) Viewed 2732 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

There has been a similar bug report lately. But I was not yet able to reproduce.
Please see your cacti.log. The plugin is quite chatty ATM. So you may deduce what happens to give me some more hints
R.
hid3
Cacti User
Posts: 63
Joined: Sat Jun 14, 2008 1:59 am

Post by hid3 »

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:

Code: Select all

Fatal error: Call to undefined function autom8_log() in /var/www/cacti/plugins/autom8/autom8_functions.php on line 27
and one for line around 53. I solved them by adding this:

Code: Select all

include_once($config['base_path'] . "/plugins/autom8/autom8_utilities.php");
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.
hid3
Cacti User
Posts: 63
Joined: Sat Jun 14, 2008 1:59 am

Post by hid3 »

I've relooked my cacti.log further and found some errors yesterday, just after I have installed and tested the plugin:

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)
Hope it helps.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

This looks like the problem:

Code: Select all

WHERE data_input_fields.type_code=output_type
Gandalf,

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?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

TheWitness wrote:This looks like the problem:

Code: Select all

WHERE data_input_fields.type_code=output_type
That was fixed some time ago. V0.33 is clean (at least for that SQL)
You need to jazz that interface up too ;)
You make me :cry: :cry: :cry:
Suggestions?
Nice plugin BTW :)
:P :P :P

R.
hid3
Cacti User
Posts: 63
Joined: Sat Jun 14, 2008 1:59 am

Post by hid3 »

*ouch* !!!

It seems I installed v0.31 by mistake!! You really need to put newest version in the very top of the downloads :D

So I reinstalled to v0.33, reconfigured everything back and now all seems to be OK. Huge thanks for the support! It's really, really awesome plugin 8)
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

gandalf wrote:
TheWitness wrote:This looks like the problem:

Code: Select all

WHERE data_input_fields.type_code=output_type
That was fixed some time ago. V0.33 is clean (at least for that SQL)
You need to jazz that interface up too ;)
You make me :cry: :cry: :cry:
Suggestions?
Nice plugin BTW :)
:P :P :P

R.
You know I was kidding right ;)

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?
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests