Problem with "output:U"

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
Doomulation
Posts: 12
Joined: Wed Mar 07, 2007 10:50 am

Problem with "output:U"

Post by Doomulation »

Hello,

I've a very annoying problem with my CPU SNMP graph for linux debian. I've make a shell (cpu.sh) likes another shell i've ever make for memory usage.

My shell:

Code: Select all

USER=`snmpwalk -v2c 172.25.162.115 -c public 1.3.6.1.4.1.2021.11.50.0 | awk -F ' ' '{print $4}'`
NICE=`snmpwalk -v2c 172.25.162.115 -c public 1.3.6.1.4.1.2021.11.51.0 | awk -F ' ' '{print $4}'`
SYSTEM=`snmpwalk -v2c 172.25.162.115 -c public 1.3.6.1.4.1.2021.11.52.0 | awk -F ' ' '{print $4}'`
IDLE=`snmpwalk -v2c 172.25.162.115 -c public 1.3.6.1.4.1.2021.11.53.0 | awk -F ' ' '{print $4}'`

printf "USER:%d NICE:%d SYSTEM:%d IDLE:%d\n" $USER $NICE $SYSTEM $IDLE
An example of the manualy result:

Code: Select all

USER:3700699 NICE:581 SYSTEM:521794 IDLE:6531591
And the cacti'logfile returns:

Code: Select all

 
03/07/2007 04:46:34 PM - CMDPHP: Poller[0] Host[8] WARNING: Result from CMD not valid. Partial Result:
03/07/2007 04:46:34 PM - CMDPHP: Poller[0] Host[8] CMD: /var/www/cacti/site/scripts/cpu.sh, output: U
Someone can help a poor french computer student?

Thanks
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Why do you use a script to fetch SNMP data, when cacti is able to do so directly? Personally, I've published a Template that reports those data and some more CPU specifics using pure SNMP.
Please log in as cactiuser (the user running the poller from crontab) and rerun your script. Perhaps PATHs are missing for snmpwalk and/or awk
Reinhard
Doomulation
Posts: 12
Joined: Wed Mar 07, 2007 10:50 am

Post by Doomulation »

can i obtain a link for your template? i 've no cacti user, it's the user root who make all the operation.

There is a paranormal problem, because Cacti works perfectly with my script for memory which returns:

Code: Select all

RAM:51288 SWAP:979232
and not with my other script ( the same shell, except the variable and the OID ) which returns:

Code: Select all

USER:5686298 NICE:1166 SYSTEM:804462 IDLE:10081779


I don't know where isthe mistake, and i don't use the script of Cacti because the snmp queries "Get Processor Information" returns 0 row :evil:

Thanks for your help...
Doomulation
Posts: 12
Joined: Wed Mar 07, 2007 10:50 am

Post by Doomulation »

I've just load ucd/net cpu usage and it work perfectly.... sorry for the inconvenience lol i've just lost one day of my work placement...

Seeyou soon and thanks again gandalf! :lol:
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest