Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Cisco SAN MDS9020 Switch Port statistics

 
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates
Author Message
kwabbernoot
Cacti User


Joined: 13 Oct 2003
Posts: 99
Location: Zottegem, Belgium

PostPosted: Wed Aug 30, 2006 5:06 am    Post subject: Cisco SAN MDS9020 Switch Port statistics Reply with quote

Hi,

I developped a Data Query that allows you to graph statistics on the Fiber Channel ports of a Cisco MDS9020 SAN Switch. The query interrogates the Fiber Alliance (http://www.fiberalliance.org) SNMP MIB v4.0

Remark: The result of the SNMP queries are sometimes in HEX format, therefor the script has a convert function attached. I noticed however that the HEX result can differ between systems. If your graphs remain empty please very the output of the script by executing it manually.
Currently the scripts detects HEX output has the following formats: "HEX-aa:bb:cc:dd:ee:ff:gg:hh:ii" or "aa:bb:cc:dd:ee:ff:gg:hh:ii"


The Data Query was created and tested in Cacti 0.8.6h.
It was exported from Cacti 0.8.6h, imported and currently used in my production Cacti 0.8.6h environment.

To use:
- Take a backup of your current Cacti DB (allows you to return if the import detroys your Cacti environment)
- Import the Data Query Export xml into your Cacti application
- Unzip/untar the attached .tar.gz file
- Place the xml file into "<path_cacti>/resource/script_queries"
- Place the script into "<path_cacti>/scripts"

Regards,
Kwabbernoot



Overview.jpg
 Description:
Example graphs
 Filesize:  116.68 KB
 Viewed:  12013 Time(s)

Overview.jpg



san_port_info.tar.gz
 Description:
Contains both the script and script_query xml information file

Download
 Filename:  san_port_info.tar.gz
 Filesize:  1.95 KB
 Downloaded:  1086 Time(s)


cacti_data_query_san_switch_port_statistics.xml
 Description:
Data Query Export/Import information

Download
 Filename:  cacti_data_query_san_switch_port_statistics.xml
 Filesize:  100.1 KB
 Downloaded:  1576 Time(s)

Back to top
matibut14



Joined: 22 Nov 2006
Posts: 8

PostPosted: Wed Nov 29, 2006 3:00 pm    Post subject: Reply with quote

Works great with the following McData SAN switches:
ES-3232 (Sphereon)
ED-6140 (Intrepid)

As you are using the Fiber Alliance MIB, I think you should remove all references to the MDS9020 in the scripts and filename.

Thanks a lot!
Back to top
skasaxaphone



Joined: 12 Dec 2006
Posts: 1

PostPosted: Tue Dec 12, 2006 5:29 pm    Post subject: trouble with template Reply with quote

I am using the same version (0.8.6h) of cacti, and I have been attempting to use this template to monitor ports on a Cisco MDS9020. when i attatch the template to the device it will not give me the option of selecting any ports as on other switches with SNMP-interfaces.

How do you properly set up the template to allow the ports to actually be monitored?
Back to top
kwabbernoot
Cacti User


Joined: 13 Oct 2003
Posts: 99
Location: Zottegem, Belgium

PostPosted: Thu Mar 01, 2007 9:23 am    Post subject: Implement script Reply with quote

Sorry for the late reply, but it has been some time since I checked the Cacti forum. If you have a specific question you can always send a private message. The system sends me a mail and I always verify them.

The implementation of the script is explained in the original post.

I could remark however to test the script from command line and if possible interrogate the SAN switch manually using snmpget or another snmp query/walk software.

Like I mention on the script
Code:

   // Its a pain in the ass, but the fiber Channel SNMP OIDS have a small difference on each device.
   // Only an SNMP walk can find the correct oid and the correct value

The snmp oids differ per switch and this does not facilitate debugging, check if the oids on your device do not differ earlier in the oid value.

If you manually modified the script/xml file to support your needs double check the syntax. When developing the script I had strange results/anomalies that were due to a typo error within the xml file. The result was that my script worked fine in command line, but failed to work within Cacti.
Back to top
johncall



Joined: 02 Dec 2006
Posts: 1
Location: BYU Hawaii

PostPosted: Fri Mar 02, 2007 7:20 am    Post subject: Error in script Reply with quote

Has anybody seen this before?

Quote:
Notice: Undefined index: sgg_13 in /var/www/cacti/graphs_new.php on line 71

Warning: Cannot modify header information - headers already sent by (output started at /var/www/cacti/graphs_new.php:71) in /var/www/cacti/graphs_new.php on line 322


I got this after I added my IBM SAN24M1 (McData Sphereon 4500) device. Then I added the data query to the device (san_port.xml). Following the 'create graphs' link I saw all of my FCSwitch ports and their descriptions. I selected about 10/12 ports to graph and saw the above error after I pressed the 'create graphs' button.

Thanks,
John
Back to top
Nesarin



Joined: 20 Dec 2006
Posts: 13

PostPosted: Fri Mar 02, 2007 1:38 pm    Post subject: Reply with quote

Sorry, I haven't seen anything like that, but I just wanted to say that I was able to get this working after a bit of a struggle. The heart of the problem that I had was that the php script seems not to work if the snmp version isn't set to 1. We monitor almost all our equipment with v2c, but when the script was run manually, I'd get undefined offset errors, however when I ran it with with version 1 at the command line, everything worked. I changed this under the device within cacti and re-added the script to the device. Lo and behold it populated the correct number of ports. I was also getting 'U' as an output for a while until I realized that I had left a few lines of output from the code up so that I could troubleshoot, once I took them out, the cacti log showed that the script was getting numbered results. AFter that, it was just a matter of deleting the rrd files for the device and letting the poller recreate them. The graphs populated and everything is working great now.

I guess the main point of my ramblings is that you have to use SNMP v 1, at least that's what I learned.
Back to top
fosforo



Joined: 28 Jun 2007
Posts: 2

PostPosted: Thu Jun 28, 2007 9:25 am    Post subject: Problem with importing XML template Reply with quote

When i try to import the XML template i get always the same error:


Error: XML: Hash version does not exist.



What i can do?
Back to top
neochi808



Joined: 22 Apr 2008
Posts: 1

PostPosted: Tue Apr 22, 2008 2:03 pm    Post subject: Script does not work on clean install of cacti-0.8.7b Reply with quote

I tried building this on the latest cacti release as of today. snmpwalk works fine from the command line, but not from cmd.php.

Downgraded to cacti-0.8.6j and all worked okay. Not sure what is causing it.
Any tips on troubleshooting this?

Thanks in advance.
Back to top
carlosruiz



Joined: 17 Jun 2008
Posts: 2

PostPosted: Wed Jun 18, 2008 12:49 am    Post subject: Reply with quote

hi

this template can work with Cisco MDS9124 i really need this one to get graphs by cacti

10xs
Back to top
Froz



Joined: 26 Aug 2008
Posts: 19

PostPosted: Tue Aug 26, 2008 2:55 pm    Post subject: Reply with quote

this is what i get when i try running the first script from the command line. any ideas??

[UTWMAD0P0698] C:\>E:\php\php.exe -q E:\cacti\scripts\query_mds9020_san_portinfo.php 10.68.1.14 public 1 query index
PHP Notice: Undefined variable: config in E:\cacti\lib\snmp.php on line 33
PHP Warning: Missing argument 7 for cacti_snmp_walk(), called in E:\cacti\scripts\query_mds9020_san_portinfo.php on lin
e 47 and defined in E:\cacti\lib\snmp.php on line 225
PHP Warning: Missing argument 8 for cacti_snmp_walk(), called in E:\cacti\scripts\query_mds9020_san_portinfo.php on lin
e 47 and defined in E:\cacti\lib\snmp.php on line 225
PHP Warning: Missing argument 9 for cacti_snmp_walk(), called in E:\cacti\scripts\query_mds9020_san_portinfo.php on lin
e 47 and defined in E:\cacti\lib\snmp.php on line 225
PHP Warning: Missing argument 10 for cacti_snmp_walk(), called in E:\cacti\scripts\query_mds9020_san_portinfo.php on li
ne 47 and defined in E:\cacti\lib\snmp.php on line 225
PHP Notice: Use of undefined constant SNMP_POLLER - assumed 'SNMP_POLLER' in E:\cacti\lib\snmp.php on line 225
PHP Fatal error: Call to undefined function read_config_option() in E:\cacti\lib\snmp.php on line 234
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group