Cisco SFP (with DOM) Optical value plugin v0.2.3 + 0.2.4b

Announcements concerning Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
bakkapo
Posts: 15
Joined: Fri Oct 21, 2011 3:04 am

Re: Cisco SFP (with DOM) Optical value plugin v0.2.3 + 0.2.4

Post by bakkapo »

Hi,
This is the CLOG information

ES+ Gigabit
10/27/2011 11:00:05 AM - SPINE: Poller[0] Host[4] Description[router1] TH[1] DS[46] Graphs['x.x.x.x SFP GigabitEthernet9/6 -'] SS[0] SERVER: /var/www/cacti/scripts/ss_65xx_sfp.php ss_sfp xxxxxxxxxxxxx 4 2:161:500:1:40:xxxxxxxxxxxxxxxx:::::: get rx GigabitEthernet9/6, output: U

ES+ TenGigabit
10/27/2011 11:00:05 AM - SPINE: Poller[0] Host[4] Description[router1] TH[1] DS[37] Graphs['router1 SFP TenGigabitEthernet1/1 '] SS[0] SERVER: /var/www/cacti/scripts/ss_65xx_sfp.php ss_sfp xxxxxxxxxxx 4 2:161:500:1:40:xxxxxxxxxxxxx:::::: get tx TenGigabitEthernet1/1, output: -3.6

ES TenGigabit
10/27/2011 11:00:08 AM - SPINE: Poller[0] Host[10] Description[router1] TH[1] DS[49] Graphs[' SFP TenGigabitEthernet1/0/0 '] SS[0] SERVER: /var/www/cacti/scripts/ss_65xx_sfp.php ss_sfp xxxxxx 10 2:161:500:1:40:xxxxxxxxxxxxx:::::: get tx TenGigabitEthernet1/0/0, output: -33

ES Gigabit
10/27/2011 11:00:04 AM - SPINE: Poller[0] Host[10] Description[router1] TH[1] DS[48] Graphs['router1 SFP GigabitEthernet9/0/10 -'] SS[0] SERVER: /var/www/cacti/scripts/ss_65xx_sfp.php ss_sfp xxxxxxxxxxx 10 2:161:500:1:40:xxxxxxxxxxx:::::: get tx GigabitEthernet9/0/10, output: -73

The last one is very strange, because there are problems with the graphics for this interface and via CLI :
php -q ss_65xx_sfp.php xxxxxxxx 10 2:161:500:1:40:xxxxxxxxxxx:::::: get tx GigabitEthernet9/0/10 //no result
For the rest of the cases, the output in CLOG and CLI is the same.

Georgi
Last edited by bakkapo on Thu Nov 03, 2011 12:12 pm, edited 2 times in total.
toe_cutter
Cacti User
Posts: 168
Joined: Fri Sep 12, 2008 2:41 am
Location: Sweden

Re: Cisco SFP (with DOM) Optical value plugin v0.2.3 + 0.2.4

Post by toe_cutter »

Was that all the output from the debug script or was there more? If you think there is too much to paste in a post, put the output in a textfile and attach it to your post. In fact, thats preferred to a huge post.

I might try and rewrite the script to use the OID's index as index, and not the interfaces name as an index. If i recall correctly we used the interface name because the OIDs index wasnt the same in all the queries, but reading from your snmpwalks earlier it doesnt seem to be that way anymore. Im trying to confirm this with my old workplace, maybe there's a difference in some new IOS.

This might take some time to figure out bakkapo, and ill probably need some more outputs from you, but ill let you know when and what of course.

//David
bakkapo
Posts: 15
Joined: Fri Oct 21, 2011 3:04 am

Re: Cisco SFP (with DOM) Optical value plugin v0.2.3 + 0.2.4

Post by bakkapo »

Hi,
I will send you a detailed and well-described document with all the result I have from snmpwalk and Cacti till tomorrow. Just for reference - the IOS is SRE4 for Cisco 7609-S chassis.

Georgi
bakkapo
Posts: 15
Joined: Fri Oct 21, 2011 3:04 am

Re: Cisco SFP (with DOM) Optical value plugin v0.2.3 + 0.2.4

Post by bakkapo »

Hi,
find attached the promised information. Now when I tested everything very carefully, I understood what you meant saying indexes are not correct. For some of the interfaces - Tengigabit ones, the indexes for the first interface on the module work fine, but for the rest, you receive a lot other indexes when you try to snmpwalk the founded index. This can be viewed int the attached files. Nice bug. I will search and probably raise it to Cisco, if hasn't been sent to them by now.
Despite everything mentioned by me, the fact that I don't see graphics for GigabitEthernet interfaces is still present. The other interesting thing I noticed is that for one of the TenGigabit interfaces - Te1/0/1, I see nan for Tx, while Rx level is visible. The invisible value is around -80.
I am sending the log of Cacti, which is set to DEBUGGING level.

I hope all this will be worthy estimating the current status of the plugin. If you can help solve all these issues, it will be great.

Regards,
Georgi
Attachments
DOM.zip
(298.93 KiB) Downloaded 699 times
toe_cutter
Cacti User
Posts: 168
Joined: Fri Sep 12, 2008 2:41 am
Location: Sweden

Re: Cisco SFP (with DOM) Optical value plugin v0.2.3 + 0.2.4

Post by toe_cutter »

Hi,

Thanks for your outputs!
Ive made some headway with the script. It seems that i was right that i wasnt matching the interface name properly (only Gi/Te was accepted, not "subslot 0/0...") and the script now uses the numeric index from the device instead of interface name, the script i think is also faster. Ill try to get some before/after numbers but it feels faster either way.

Since it uses new indexes i think youll have to re-create your graphs. Unless history is vital for you, this is the easiest and quickest way. Ill create new templates and xmls and upload everything tomorrow or the day after tomorrow.

On a sidenote, does Boris' templates (page 4 iirc) work with 0.8.7h? If so you should use them because spine+pure snmp is always preferable over a script.

//David
FirstLast
Posts: 7
Joined: Wed Feb 24, 2010 10:32 am

Re: Cisco SFP (with DOM) Optical value plugin v0.2.3 + 0.2.4

Post by FirstLast »

Hi all,

updated version of Cisco SFP (with DOM) Optical value plugin still doesn't work for me in respect to be able to read DOM from SFP-GE-L transceivers I have plugged in into 5-port SPA-5X1GE-V2 cards installed into 7600-SIP-600-DC modules.

No issues with getting values when SFP installed into Supervisor VS-S720-10G. ( i.t int Te5/4, 6/4 in 6509 )

I know DOM works because I can manually retrieve values, i.e. :

Router#sho hw-module subslot 8/0 transceiver 4 status
The Transceiver in slot 8 subslot 0 port 4 is enabled.
Module temperature = +22.230 C
Transceiver Tx supply voltage = 3275.6 uVolts
Transceiver Tx bias current = 3130 uAmps
Transceiver Tx power = -6 dBm
Transceiver Rx optical power = -7 dBm


However, when I run old or new php script, it never sees any of int Gi8/0/? as DOM capable :

C:\Apache\htdocs\cacti\scripts>php -q ss_65xx_sfp.php A.B.C.D public 2 query index
TenGigabitEthernet5/4:TenGigabitEthernet5/4
C:\Apache\htdocs\cacti\scripts>

I have to point out that usual syntax which works for Sup ( show int Te5/4 transceiver ) does not work for SFPs installed in SPA ports returning :

Router#sho int Gi8/0/0 transceiver
Module 8 doesn't support DOM

but obviously DOM works because sub-slot syntax does return Tx/Rx Power.

However, I was unable to find proper query to get interfaces which are DOM capable.

IOS is : s72033-adventerprisek9_wan-mz.122-33.SXI2.bin

I found this : http://www.snmplink.org/OnLineMIB/Cisco/index.html#2905

but my 6509 doesn't want to return anything from ciscoModules although every IOS after SXH shows it as supported.

Was anybody able to get readings from SPA ports ? Does anybody need more details on my hardware ?

Regards
toe_cutter
Cacti User
Posts: 168
Joined: Fri Sep 12, 2008 2:41 am
Location: Sweden

Re: Cisco SFP (with DOM) Optical value plugin v0.2.3 + 0.2.4

Post by toe_cutter »

Hi all,

Attached is the script, its xml-file and the graph template with dependancies.
This works for sure on VSS 6500s and ASR1002. The 6500 reported the interfaces as regular Te(1/)4/5 and the ASR as subslot 0/0 transciever 1. I think the latter way is a new standard from Cisco, we are obviously seeing them more often, it works on both either way.

I also got good numbers, i didnt have to divide the result with 10 again, it is and always has been done in the script. Im not sure why it did that, it might do it again, let me know if so please. The script seems faster, i didnt have time to get hard numbers but its fairly noticable.
I added some more information since i was using numbered indexes instead of interface names. When choosing interfaces to create the graphs from you should be reading the interfaces numeric index, interface name, interface description (if there is one), and if Tx/Rx are online or not. If you dont see all this, reindex (click the little green circle on the right) and you should be fine.

Dont forget to backup the old script, its xml-file and the graph and data template.
I suggest deleting your old graphs and recreating them with the new script, its just easier to do it this way instead of fiddling with finding out indexes and making your graphs work.

Let me and Sodium know in this thread if there are any other new problems.

Edit: i updated the date in the script header, and upped the version. No biggie.
Edit2: FirstLast: This update should fix your problem too.
Attachments
cisco_sfp.xml.zip
Extract and put in cacti/resources/script_server folder.
(1 KiB) Downloaded 851 times
ss_65xx_sfp.php.txt
Rename to only .php and put in scripts folder.
(11.18 KiB) Downloaded 904 times
cacti_graph_template_cisco_-_sfp_statistics_dbm.xml.zip
Extract and import into Cacti via the Import tool.
(2.49 KiB) Downloaded 733 times
Last edited by toe_cutter on Fri Nov 04, 2011 4:02 pm, edited 1 time in total.
sodium
Cacti User
Posts: 115
Joined: Wed Feb 01, 2006 10:29 am

Re: Cisco SFP (with DOM) Optical value plugin v0.2.3 + 0.2.4

Post by sodium »

I'll test them in my environment and post back :)
All the problems of the world could be settled if people were only willing to think...
bakkapo
Posts: 15
Joined: Fri Oct 21, 2011 3:04 am

Re: Cisco SFP (with DOM) Optical value plugin v0.2.3 + 0.2.4

Post by bakkapo »

Hi,
I tried to rename the old files and import the new xml template. The cacti templates and corresponding elements were just updated, but then I received the following problem:

+ Running data query [13].
+ Found type = '6' [Script Query - Script Server].
+ Found data query XML file at '/var/www/cacti/site/resource/script_server/cisco_sfp.xml'
+ XML file parsed ok.
+ <arg_num_indexes> missing in XML file, 'Index Count Changed' not supported
+ Executing script for list of indexes '"/usr/bin/php" -q /var/www/cacti/site/scripts/ss_65xx_sfp.php x.x.x.x 10 2:161:500:1:40:xxxxxxxxxx:::::: index' Index Count: 0
+ Executing script query '"/usr/bin/php" -q /var/www/cacti/site/scripts/ss_65xx_sfp.php x.x.x.x 10 2:161:500:1:40:xxxxxxxxxxx:::::: query sfpindex'
+ Executing script query '"/usr/bin/php" -q /var/www/cacti/site/scripts/ss_65xx_sfp.php x.x.x.x 10 2:161:500:1:40:xxxxxxxxxx:::::: query status'
+ Executing script query '"/usr/bin/php" -q /var/www/cacti/site/scripts/ss_65xx_sfp.php x.x.x.x 10 2:161:500:1:40:xxxxxxxxxx:::::: query interface'
+ Executing script query '"/usr/bin/php" -q /var/www/cacti/site/scripts/ss_65xx_sfp.php x.x.x.x 10 2:161:500:1:40:xxxxxxxxxxx:::::: query descr'

There are no matches for any interface.
Data Query [Cisco - 65xx - SFP statistics]
This data query returned 0 rows, perhaps there was a problem executing this data query. You can run this data query in debug mode to get more information.

Then I decided to delete all graph templates, data templates and so on and to import the new template again. This time now data query was imported and I wasn't able to use the new script.

Could you verify whether I am missing something.

regards,
Georgi
toe_cutter
Cacti User
Posts: 168
Joined: Fri Sep 12, 2008 2:41 am
Location: Sweden

Re: Cisco SFP (with DOM) Optical value plugin v0.2.3 + 0.2.4

Post by toe_cutter »

The magic workings of Cacti...
The last thing i did before leaving was to reindex and create graphs for 10 devices, they all found the SFPs attached and the graphs were working. I actually didnt touch the graph/data templates, i only included them for the sake of having a complete set and so that users would have templates that worked for me.

Was the data query also imported (into the menu Data Queries)? I seem to be missing that from the template i exported.
I actually never tested the script for snmpv2, but id think that wouldnt be a problem.
If you run the script for itself, i take it that it works? For instance:

Code: Select all

php ss_65xx_sfp.php x.x.x.x 10 2:161:500:1:40:xxxxxxxxxx:::::: query interface
If that works, try running it from the script server:

Code: Select all

(cacti root directory)
php script_server.php
/var/www/cacti/site/scripts/ss_65xx_sfp.php ss_sfp x.x.x.x 10 2:161:500:1:40:xxxxxxxxxx:::::: query interface
If that works, im not sure what else to try :(
Sodium/FirstLast: Is it working for you?
bakkapo
Posts: 15
Joined: Fri Oct 21, 2011 3:04 am

Re: Cisco SFP (with DOM) Optical value plugin v0.2.3 + 0.2.4

Post by bakkapo »

Hi,
The cli execution of the script returns some errors:
[pesho@pesho scripts]# php -q ss_65xx_sfp.php.new x.x.x.x 10 2:161:500:1:40:xxxxxxxxxxxx:::::: query interface
PHP Notice: Undefined offset: 1 in /var/www/cacti/scripts/ss_65xx_sfp.php.new on line 46
PHP Notice: Undefined offset: 2 in /var/www/cacti/scripts/ss_65xx_sfp.php.new on line 47
PHP Notice: Undefined offset: 3 in /var/www/cacti/scripts/ss_65xx_sfp.php.new on line 48
PHP Notice: Undefined offset: 4 in /var/www/cacti/scripts/ss_65xx_sfp.php.new on line 49
PHP Notice: Undefined offset: 5 in /var/www/cacti/scripts/ss_65xx_sfp.php.new on line 50
PHP Notice: Undefined offset: 6 in /var/www/cacti/scripts/ss_65xx_sfp.php.new on line 51
PHP Notice: Undefined offset: 7 in /var/www/cacti/scripts/ss_65xx_sfp.php.new on line 69

While importing the template the output is something like this:
GPRINT Preset
[success] Optical Power [update]

Data Input Method
[success] Get Script Server Data (Indexed) [update]

Data Template
[success] Cisco 65xx - SFP statistics [update]

Graph Template
[success] Cisco - SFP statistics (dBm) [update]

In the previous version a Data Query is also noticed to be imported.

By the way, the problem with wrong results for taking the optic power levels for some interfaces via snmpwalk is due to the version of the NET-SNMP package. It is present for version 5.5 and not for 5.4.1. I will dig a little bit further to isolate the exact difference and behaviour of snmpwalk.

Georgi
toe_cutter
Cacti User
Posts: 168
Joined: Fri Sep 12, 2008 2:41 am
Location: Sweden

Re: Cisco SFP (with DOM) Optical value plugin v0.2.3 + 0.2.4

Post by toe_cutter »

Oh crap, i know whats wrong. Ive updated the post with the files, you will want to download cisco_sfp.xml.zip again.

I think i made the change because i was having problems with undefined indexes myself, and got it working by making everything separated by ":" instead of hostname and host_id separated by a space. How/why i copied over an old cisco_sfp.xml i dont know, sorry for that, i hope it works better now!

Im pretty sure im not running net-snmp5.5, ive asked a colleague to check, but he might not be able to check until monday. Its odd that some devices would work properly and some others not. Let us know what you find, we might be able to add a check for it.
bakkapo
Posts: 15
Joined: Fri Oct 21, 2011 3:04 am

Re: Cisco SFP (with DOM) Optical value plugin v0.2.3 + 0.2.4

Post by bakkapo »

Hi,
I can confirm that now it works for all types of interfaces and cisco modules. I got some problems with the consolidation functions, but it was in my garden. I allowed all types of CFs in the RRAs and recreated the graphs. I don't know whether this was you idea, but Data Query is still not imported with the latest set of files. So I had to use the old one, generated during import of the old scripts.
I hope this long correspondence and your work will be useful not only for me....

Thank you and you have a beer or two from me, although Sweden is a little bit far away ... :)

Georgi
sodium
Cacti User
Posts: 115
Joined: Wed Feb 01, 2006 10:29 am

Re: Cisco SFP (with DOM) Optical value plugin v0.2.3 + 0.2.4

Post by sodium »

Cool to read that it's fixed now! great work toe_cutter!

I'm still waiting for ACL's being changed so my test environment can access the new type SFPs :-(

@toe_cutter I'll adapt our script so it can access SPA (4 bay Cisco 10000 SPA Jacket Card)
All the problems of the world could be settled if people were only willing to think...
toe_cutter
Cacti User
Posts: 168
Joined: Fri Sep 12, 2008 2:41 am
Location: Sweden

Re: Cisco SFP (with DOM) Optical value plugin v0.2.3 + 0.2.4

Post by toe_cutter »

bakkapo wrote:Hi,
I can confirm that now it works for all types of interfaces and cisco modules. I got some problems with the consolidation functions, but it was in my garden. I allowed all types of CFs in the RRAs and recreated the graphs. I don't know whether this was you idea, but Data Query is still not imported with the latest set of files. So I had to use the old one, generated during import of the old scripts.
I hope this long correspondence and your work will be useful not only for me....

Thank you and you have a beer or two from me, although Sweden is a little bit far away ... :)

Georgi
Glad to hear that its working! :)
Yeah, i thought the Data Query would go along the graph template when i exported it with dependancies, guess not! :/
Hehe, beer is on the balcony getting chilled :)
sodium wrote:Cool to read that it's fixed now! great work toe_cutter!

I'm still waiting for ACL's being changed so my test environment can access the new type SFPs :-(

@toe_cutter I'll adapt our script so it can access SPA (4 bay Cisco 10000 SPA Jacket Card)
Heh, thanks :)
I actually had to visit my old workplace to test this, spent two days there and they told me that if i stayed any longer they would have to hire me, in case i did something wrong and ruined their net :p
Edit and adapt all you want, im curious to how SPA does DOM! Ive never heard of those cards, Google images show some that look like the ones in an ASR...

@Everybody: Have a nice weekend!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest