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

Announcements concerning Plugins for Cacti

Moderators: Developers, Moderators

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

Post by toe_cutter »

zorrosam wrote:1) there's no include_once(dirname(__FILE__) . "/../include/global.php");
Ive updated the script to fix this, i guess sodium just missed it.

I imported the template to 0.8.7a, upgraded to 0.8.7d and then exported it and got it working on our production 0.8.7d.
For some reason it wasnt getting an index if sodiums template was imported directly to 0.8.7d. Could have just been me forgetting stuff, so to make sure, check that you got the right permissions on the php-script and the cisco_sfp.xml.

Enjoy!

Also, maybe move this thread to Scripts and templates forum? As its not really a plugin...
Attachments
cacti_data_query_cisco_-_65xx_-_sfp_statistics.xml
Import via cacti.
(14.65 KiB) Downloaded 540 times
cisco_sfp.xml
Put in your ../resource/script_server/-directory
(1.74 KiB) Downloaded 510 times
ss_65xx_sfp.php.txt
Put in your ../scripts/-directory and rename to ss_65xx_sfp.php
(8.5 KiB) Downloaded 618 times
sodium
Cacti User
Posts: 115
Joined: Wed Feb 01, 2006 10:29 am

Post by sodium »

Thanks for the update...
I'll update (and move) this script to an other place (when I have some time again :-? ) in the future for now the your update will do!

Thanks for the support :)
toe_cutter
Cacti User
Posts: 168
Joined: Fri Sep 12, 2008 2:41 am
Location: Sweden

Post by toe_cutter »

Updated the script for SNMPv3.
v3 _works_.
v2 _SHOULD_ work.

I also know that the template does work with 0.8.7e.

Any moderators could move this to Scripts/template-forum ;)
Attachments
ss_65xx_sfp.php.txt
copy to <cacti_path>/scripts and rename to ss_65xx_sfp.php
(10.26 KiB) Downloaded 444 times
cisco_sfp.xml
copy to <cacti_path>/resource/script_server
(1.96 KiB) Downloaded 372 times
cacti_data_query_cisco_-_65xx_-_sfp_statistics.xml
import into cacti after the other two below.
(15.03 KiB) Downloaded 578 times
sodium
Cacti User
Posts: 115
Joined: Wed Feb 01, 2006 10:29 am

Post by sodium »

Yes please move it :) (i do not have the permissions to move it...)

Thanks for your additions :)
toe_cutter
Cacti User
Posts: 168
Joined: Fri Sep 12, 2008 2:41 am
Location: Sweden

Post by toe_cutter »

Me again :)
Im having problems with the script server timing out, so i decided to go through the scripts and see what i could do to make them faster.
Not that the changes to this script helped against the timeouts :/

Anyway:

New and improved times!

Code: Select all

index: 0m0.582s
query index: 0m0.895s
query status: 0m1.516s
get rx: 0m1.093s
get tx: 0m1.038s
Old:

Code: Select all

index: 0m1.510s
query index: 0m1.038s
query status: 0m1.515s
get rx: 0m1.032s
get tx: 0m1.045s
Only improved the indexing as you can see, i tried with the get's but couldnt. If thats because of my lack of php-skill, i do not know.

Edit:
Oh wow, i just noticed that this script/template never has been running via Script Server :o (according to tutorials in the Cacti documentation atl east, also 'ps aux | grep php' showed the script running outside of the script server)
Fixed this and heres the new stuff:
Attachments
cacti_data_query_cisco_-_65xx_-_sfp_statistics.xml
Import into cacti
(13.14 KiB) Downloaded 399 times
cisco_sfp.xml
put in resource/script_server
(1.99 KiB) Downloaded 434 times
ss_65xx_sfp.php.txt
put in scripts-directory and rename to ss_65xx_sfp.php
(8.97 KiB) Downloaded 479 times
sodium
Cacti User
Posts: 115
Joined: Wed Feb 01, 2006 10:29 am

Post by sodium »

Thanks, that I have missed that :-(

You have once proven again that open source is a great thing.
toe_cutter
Cacti User
Posts: 168
Joined: Fri Sep 12, 2008 2:41 am
Location: Sweden

Post by toe_cutter »

sodium wrote:Thanks, that I have missed that :-(

You have once proven again that open source is a great thing.
Hey, it's all thanks to you who made it in the first place! :)

Also, another instruction if youre already running the script, after importing the templates, you need to rebuild the poller cache, after that its all set for running via ScriptServer (you can check in Poller Cache, youll see something like this .../ss_65xx_sfp.php ss_65xx_sfp 10 3 etc...).
PayableOnDeath
Posts: 18
Joined: Mon Jul 13, 2009 4:11 pm

Post by PayableOnDeath »

Hi

I have set this up on a 6500 with 10gig ports, when I run the script I get following error

Code: Select all

Notice: Undefined offset:  1 in /usr/share/cacti/site/scripts/ss_65xx_sfp.php on line 47

Notice: Undefined offset:  2 in /usr/share/cacti/site/scripts/ss_65xx_sfp.php on line 48

Notice: Undefined offset:  3 in /usr/share/cacti/site/scripts/ss_65xx_sfp.php on line 49

Notice: Undefined offset:  4 in /usr/share/cacti/site/scripts/ss_65xx_sfp.php on line 50

Notice: Undefined offset:  5 in /usr/share/cacti/site/scripts/ss_65xx_sfp.php on line 68
any ideas?

regards

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

Post by sodium »

what version of the scripts did you use? (toe_cutter or mine)
what is the version of cacti?
what platform (unix / windows)

or do I need to guess them all :)
PayableOnDeath
Posts: 18
Joined: Mon Jul 13, 2009 4:11 pm

Post by PayableOnDeath »

Hi

yours didnt seem to have the right mibs when I did an snmp walk.

I am using toe_cutter's Mon Oct 12, 2009 8:48 am also tried the one before that with the same problem

running on ubuntu, latest copy of cacti

Regards

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

Post by toe_cutter »

Hi,

You have to supply the correct arguments to the script, like what snmp-port, community, version etc.
The correct cli-string to get the index should be (v1-v2c only):

Code: Select all

php ss_65xx_sfp.php <hostname> "" <snmp-version>:<snmp-port>:<snmp-timeout>:<ping-retries>:<max-oids>:<snmp-community> index
snmpv3 is just more arguments, also for actually getting a value, i didnt feel like rambling them :p

If you have added a couple graphs to cacti with this script already, you should see what the argument-string would look like in your Poller cache. Just search for your ports and youll see how the script is run.

Also i see now that i didnt fix sodiums comments in the script on how to retrieve index/status/values etc.. should do that.. maybe tomorrow.
PayableOnDeath
Posts: 18
Joined: Mon Jul 13, 2009 4:11 pm

Post by PayableOnDeath »

Hi

The Poller cache shows the following

I have changed the ip and snmp community below

Code: Select all

Script Server: /usr/bin/php -q /usr/share/cacti/site/scripts/ss_65xx_sfp.php ss_sfp 123.123.123.123 2 2:161:500:1:10:snmpcommunity:::MD5::DES: get tx TenGigabitEthernet1/1

any ideas?


Regards

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

Post by toe_cutter »

Looks right to me, what do you get if you run that in cli?
PayableOnDeath
Posts: 18
Joined: Mon Jul 13, 2009 4:11 pm

Post by PayableOnDeath »

Code: Select all

Notice: Undefined offset:  1 in /usr/share/cacti/site/scripts/ss_65xx_sfp.php on line 47

Notice: Undefined offset:  2 in /usr/share/cacti/site/scripts/ss_65xx_sfp.php on line 48

Notice: Undefined offset:  3 in /usr/share/cacti/site/scripts/ss_65xx_sfp.php on line 49

Notice: Undefined offset:  4 in /usr/share/cacti/site/scripts/ss_65xx_sfp.php on line 50

Notice: Undefined offset:  5 in /usr/share/cacti/site/scripts/ss_65xx_sfp.php on line 68
No log handling enabled - turning on stderr logging
getaddrinfo: ss_sfp Name or service not known
just found out that if I remove ss_sfp after ss_65xx_sfp.php then I get -3

so does that mean I have remove the ss_sfp bit from cacti some how?
toe_cutter
Cacti User
Posts: 168
Joined: Fri Sep 12, 2008 2:41 am
Location: Sweden

Post by toe_cutter »

PayableOnDeath wrote:

Code: Select all

Notice: Undefined offset:  1 in /usr/share/cacti/site/scripts/ss_65xx_sfp.php on line 47

Notice: Undefined offset:  2 in /usr/share/cacti/site/scripts/ss_65xx_sfp.php on line 48

Notice: Undefined offset:  3 in /usr/share/cacti/site/scripts/ss_65xx_sfp.php on line 49

Notice: Undefined offset:  4 in /usr/share/cacti/site/scripts/ss_65xx_sfp.php on line 50

Notice: Undefined offset:  5 in /usr/share/cacti/site/scripts/ss_65xx_sfp.php on line 68
No log handling enabled - turning on stderr logging
getaddrinfo: ss_sfp Name or service not known
just found out that if I remove ss_sfp after ss_65xx_sfp.php then I get -3

so does that mean I have remove the ss_sfp bit from cacti some how?
Sorry, i forgot, ss_sfp should be removed before running the script in cli. And since you get -3 without it, your graphs should be working just fine.

Edit: ss_sfp is used by cacti script server, its needed by cacti, so dont remove it from cacti.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests