Need help with illogical "exec"-behaviour!

Thomas Kindermann/KRZN/DE <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <OFAE80F587.4EB9F79A-ONC12570EA.002B7B73-C12570EA.002B91F2@KRZN.DE>
Hallo everybody!

I've a problem with the „exec“-command on ucd/net-snmp!
I've added the following command to the snmpd.conf:

exec .1.3.6.1.4.1.2021.50 cpuload /usr/share/snmp/cpu

„cpu“ is a own C-program which calculates the cpu-load in percent for each 
cpu out the counters in /proc/stat. Each time the program ist called, it 
takes the difference between the actual counters-stats and the 
counter-stats in a temp-file which was made at the last execution.
So far, so good! As you can see, the program work's fine when you execute 
it in a shell! It detects 8 CPU-entries in /proc/stat and puts out 8 
values.

And now my problem:

I've recompiled the original Suse ucd-snmp *.rpm the get the 
ucd-snmp/diskio-MIB inside it. And when I call .1.3.6.1.4.1.2021.50 the 
output is something like that one you can see beneath. Snmpd doesn't 
display the float-values. Instead of the float-values you only have „0.00“ 
or „nan“ or „-inf“.
But with the ORIGINAL Suse *.rpm it WORKS! Beneath you can see the two 
./configure commands. The first one is from the Suse *.rpm and the second 
one is mine.

Does anybody have an idea what this illogical thing could be?

About an answer I would be pleased really much!

greetings
Tommy


--- program startet in shell:

m180ocl0n1:/usr/share/snmp # ./cpu
1.82
0.17
0.33
0.33
2.16
0.66
0.00
0.17

8 CPU(s) detected | 6.03 second average
Calculated out of 4 values.


--- and called via snmpwalk:

m180ocl0n1:/usr/share/snmp # snmpwalk -c dekzn -v 1 localhost 
.1.3.6.1.4.1.2021.50
UCD-SNMP-MIB::ucdavis.50.1.1 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.50.2.1 = STRING: "cpuload"
UCD-SNMP-MIB::ucdavis.50.3.1 = STRING: "/usr/share/snmp/cpu"
UCD-SNMP-MIB::ucdavis.50.100.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.50.101.1 = STRING: "0.00"
UCD-SNMP-MIB::ucdavis.50.101.2 = STRING: " nan"
UCD-SNMP-MIB::ucdavis.50.101.3 = STRING: " nan"
UCD-SNMP-MIB::ucdavis.50.101.4 = STRING: "0.00"
UCD-SNMP-MIB::ucdavis.50.101.5 = STRING: " nan"
UCD-SNMP-MIB::ucdavis.50.101.6 = STRING: " nan"
UCD-SNMP-MIB::ucdavis.50.101.7 = STRING: " nan"
UCD-SNMP-MIB::ucdavis.50.101.8 = STRING: "0.00"
UCD-SNMP-MIB::ucdavis.50.101.9 = ""
UCD-SNMP-MIB::ucdavis.50.101.10 = STRING: "8 CPU(s) detected | 0.00 second 
average"
UCD-SNMP-MIB::ucdavis.50.101.11 = STRING: "Calculated out of 4 values."
UCD-SNMP-MIB::ucdavis.50.102.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.50.103.1 = ""



Suse 8 original - ucdsnmp-4.2.5-132

./configure --prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin 
--with-sys-contact=root@localhost --with-mib-modules='host ucd-snmp/diskio 
ucd-snmp/pass_persist' --with-persistent-directory=/var/ucd-snmp 
--with-sys-location=unknown --with-libwrap=/usr --with-defaults 
--enable-shared --disable-static --without-root-access --enable-ipv6 
--libdir=/usr/lib --mandir=/usr/share/man --sysconfdir=/etc CFLAGS=-O2 
-march=i586 -mcpu=i686 -fmessage-length=0 -D_GNU_SOURCE -I/usr/include/db1 
-Wall

my own commands:

./configure --prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin 
--with-sys-contact=root@localhost --with-mib-modules='host ucd-snmp/diskio 
ucd-snmp/pass_persist' --with-persistent-directory=/var/ucd-snmp 
--with-sys-location=unknown --with-libwrap=/usr --with-defaults 
--enable-shared --disable-static --without-root-access --enable-ipv6 
--libdir=/usr/lib --mandir=/usr/share/man --sysconfdir=/etc CFLAGS='-O2 
-march=i586 -mcpu=i686 -I/usr/include/db1 -Wall'
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.