Basically the problem I have is that I have a perl script that does
basically a stat on a file and figures out how old in minutes the file
is and spits out to stdout the minutes it is behind. Running the
command from the command line as root runs exactly as it should. When I
run snmpwalk and dump output for the exec program it shows stat fails
with permission denied. What has changed in the newer versions that
would cause the perl to run in a context that would cause the permission
denied? This works in older net-snmp applications. Here's conf and
output from walk:
LOCAL.CONF
proc mountd
proc ntalkd 4
proc sendmail 10 1
exec echotest /bin/echo this is a filler and should be replaced
eventueally 11-21-2006
exec file_age1 /usr/bin/file_age.pl
/home/content/users/xxxxxx/logs/xxxxxxx-audit.log
PERL SCRIPT
#!/usr/bin/perl
my $stat = `stat $ARGV[0]`;
my $mtime = (stat $ARGV[0])[10];
my $time = time;
my $age = int (($time -$mtime)/60);
print "$age - $ARGV[0] - $stat\n";
#print $ENV{'LOGNAME'} . "\n";
OUTPUT:
[r...@servername snmp]# snmpwalk -v1 -c mycommunity xx.xx.xxx.xxx
.1.3.6.1.4.1.2021.8.1.101
UCD-SNMP-MIB::extOutput.1 = STRING: this is a filler and should be
replaced eventueally 11-21-2006
UCD-SNMP-MIB::extOutput.2 = STRING: stat: cannot stat
`/home/content/users/megasports/logs/megasports-audit.log': Permission
denied
20616226 - /home/content/users/megasports/logs/megasports-audit.log -
Steve Stevenson
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders