i wrote a script to get snmp information from a Redline system
-----script start---------
#!/bin/sh
RSSMIN=`snmpwalk -v 1 -c public $1 1.3.6.1.4.1.10728.2.16.3.3.1.0 |grep INTEGER | cut -c56-57`
RSSMEAN=`snmpwalk -v 1 -c public $1 1.3.6.1.4.1.10728.2.16.3.3.2.0 |grep INTEGER | cut -c56-57`
RSSMAX=`snmpwalk -v 1 -c public $1 1.3.6.1.4.1.10728.2.16.3.3.3.0 |grep INTEGER | cut -c56-57`
SINADR=`snmpwalk -v 1 -c public $1 1.3.6.1.4.1.10728.2.16.3.3.4.0 |grep INTEGER | cut -c56-57`
printf "rssmin:%d rssmean:%d rssmax:%d sinadr:%d\n" $RSSMIN $RSSMEAN $RSSMAX $SINADR
-----------script end--------
when i run from command line as user cactiuser(the poller user) i get this
[cactiuser@redhat log]$ /var/www/html/cacti/scripts/redline_dbm 199.202.64.253
rssmin:50 rssmean:49 rssmax:49 sinadr:8
[cactiuser@redhat log]$
but when i check the cacti.log , the poller answers this :
11/08/2005 04:17:35 PM - CACTID: Poller[0] Host[12] DS[111] SCRIPT: sh /var/www/html/cacti/scripts/redline_dbm 199.202.64.253, output: rssmin:0 rssmean:0 rssmax:0 sinadr:0
someone has an idea why ?
Script returns 0 values
Moderators: Developers, Moderators
Without more detail it is tough to say, do you have exact error messages?
One thing to think about:
Put full paths in your scripts.
Example in your script:
DONT DO
snmpwalk xxx
DO
/usr/local/sbin/snmpwalk xxx
Of course you should check and test (and know) the full path to your binaries.
Example type:
whereis snmpwalk
/opt/net-snmp/bin/snmpwalk
As you can see, mine is in a custom location.
Putting the full path to things is not only a good security idea,
it sometimes fixes things being run by cron (since the cron specified user may not have the same path variables as you).
One thing to think about:
Put full paths in your scripts.
Example in your script:
DONT DO
snmpwalk xxx
DO
/usr/local/sbin/snmpwalk xxx
Of course you should check and test (and know) the full path to your binaries.
Example type:
whereis snmpwalk
/opt/net-snmp/bin/snmpwalk
As you can see, mine is in a custom location.
Putting the full path to things is not only a good security idea,
it sometimes fixes things being run by cron (since the cron specified user may not have the same path variables as you).
Thank you,
Ernie
http://www.NMSWorld.com
[b]Dual Zeon Dual Core 2.6Ghz / 8GB RAM / 4x15k RPM SATA RAID5[/b]
[b]Cacti Version[/b] - 0.8.7b
[b]Poller Type[/b] - cactid 0.8.7 with Boost v1.7
[b]Server Info[/b] - FreeBSD 7.0-RELEASE
[b]Web Server[/b] - Apache/2.2.6 (Unix) mod_ssl/2.2.6 OpenSSL/0.9.8g DAV/2 PHP/5.2.5 mod_perl/2.0.3 Perl/v5.8.8
[b]PHP[/b] - 5.2.6
[b]MySQL[/b] - 5.0.51b Mod: poller_output ENGINE = MEMORY
[b]RRDTool[/b] - 1.3.0
[b]SNMP[/b] - 5.4.1
[b]Plugins[/b] - Host Info (hostinfo - v0.2), Update Checker (update - v0.3), Network Tools (tools - v0.2), FlowView (flowview - v0.3), Read-only Devices Tab (devices - v0.4), Network Discovery (discovery - v0.8.3), Syslog Monitoring (syslog - v0.5.2), Thresholds (thold - v0.3.9), Device Monitoring (monitor - v0.8.2), PHP Network Weathermap (weathermap - v0.941), SuperLinks (superlinks - v0.72), Report Creator (reports - v0.1b)
Ernie
http://www.NMSWorld.com
[b]Dual Zeon Dual Core 2.6Ghz / 8GB RAM / 4x15k RPM SATA RAID5[/b]
[b]Cacti Version[/b] - 0.8.7b
[b]Poller Type[/b] - cactid 0.8.7 with Boost v1.7
[b]Server Info[/b] - FreeBSD 7.0-RELEASE
[b]Web Server[/b] - Apache/2.2.6 (Unix) mod_ssl/2.2.6 OpenSSL/0.9.8g DAV/2 PHP/5.2.5 mod_perl/2.0.3 Perl/v5.8.8
[b]PHP[/b] - 5.2.6
[b]MySQL[/b] - 5.0.51b Mod: poller_output ENGINE = MEMORY
[b]RRDTool[/b] - 1.3.0
[b]SNMP[/b] - 5.4.1
[b]Plugins[/b] - Host Info (hostinfo - v0.2), Update Checker (update - v0.3), Network Tools (tools - v0.2), FlowView (flowview - v0.3), Read-only Devices Tab (devices - v0.4), Network Discovery (discovery - v0.8.3), Syslog Monitoring (syslog - v0.5.2), Thresholds (thold - v0.3.9), Device Monitoring (monitor - v0.8.2), PHP Network Weathermap (weathermap - v0.941), SuperLinks (superlinks - v0.72), Report Creator (reports - v0.1b)
Who is online
Users browsing this forum: No registered users and 0 guests