Ad blocker detected: Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker on our website.
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...
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!
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 :/
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 (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:
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...).
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
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):
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.
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?
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.