I have a data input method script to get current calls and the graph is ok with cacti 0.8.7a on windows host.
//------------------------------------------
#!/usr/bin/perl -w
@lists=`snmpwalk -Ov -v 2c -c snmp_str 10.84.10.29 1.3.6.1.4.1.9.9.63.1.3.2.1.25`;
$calls = @lists/2;
$test=400;
print $calls;
//----------------------------------------------
On linux host with cacti 0.8.6h, althought output value is returned when run perl command line, the cacti graph value is NaN.
[root@nms-cacti /]# perl var/www/html/cacti/scripts/ipgwcall2.pl
45[root@nms-cacti /]#
in Cacti log shows Output :0
04/02/2008 03:45:02 PM - CACTID: Poller[0] Host[0] DS[659] SCRIPT: perl /var/www/html/cacti/scripts/ipgwcall2.pl, output: 0
I misunderstand because if i replace $calls by a contant value $test , datasource output is 400 and the graph shows this value (400)
Something is wrong with my script or Cacti ? Need someone help me !
Script is ok on perl command line but datasource output :0
Moderators: Developers, Moderators
-
- Posts: 2
- Joined: Tue Feb 26, 2008 10:27 pm
- TheWitness
- Developer
- Posts: 17064
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Use snmpget instead of snmpwalk, and then don't use an array.
TheWitness
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?
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?
- TheWitness
- Developer
- Posts: 17064
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
I also suggest that you simply use the snmp functions in cacti instead of perl, as it's much faster and then use a cdef to do the division.
TheWitness
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?
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?
-
- Posts: 2
- Joined: Tue Feb 26, 2008 10:27 pm
Thank you !
But I think the problem is snmpwalk(or snmpget) don't run when cacti poller calls script, so no output value return.
Have output return in perl command line, and everything' s ok with cacti 0.87a installed in windows host (output value, graph shows)
But It crazy in linux ! I'm a linux newbie.
But I think the problem is snmpwalk(or snmpget) don't run when cacti poller calls script, so no output value return.
Have output return in perl command line, and everything' s ok with cacti 0.87a installed in windows host (output value, graph shows)
But It crazy in linux ! I'm a linux newbie.
Who is online
Users browsing this forum: No registered users and 2 guests