Code: Select all
#!/bin/sh
ssCpuRawUser=`$1 -Ont $2 $3 .1.3.6.1.4.1.2021.11.50.0|cut -d" " -f4`
ssCpuRawNice=`$1 -Ont $2 $3 .1.3.6.1.4.1.2021.11.51.0|cut -d" " -f4`
ssCpuRawSystem=`$1 -Ont $2 $3 .1.3.6.1.4.1.2021.11.52.0|cut -d" " -f4`
ssCpuRawIdle=`$1 -Ont $2 $3 .1.3.6.1.4.1.2021.11.53.0|cut -d" " -f4`
echo $ssCpuRawUser $ssCpuRawNice $ssCpuRawSystem $ssCpuRawIdle
Name:
Code: Select all
Get SNMP CPU Info Linux
Code: Select all
<path_cacti>/scripts/get_snmp_cpu_info_linux.sh <path_snmpget> <ip> <community>
Code: Select all
<user> <nice> <sys> <idle>
Code: Select all
Type the Linux IP / ip / input / not update RRA
Type the Linux community / community / input / not update RRA
User / user / output / update RRA
Nice / nice / output / update RRA
Sys / sys / output / update RRA
Idle / idle / output / update RRA
Create the Data Source as usual (using "Get SNMP CPU Info Linux" as Data Input Type). Notice: these values are COUNTERS, not GAUGE (although it's a CPU information). So the "Minimum Value" MUST BE set to "4294967296" or higher (Counter32 data type)
Don't forget to click in "Edit Data" and input the IP and COMMUNITY.
Feel free to create the Graph using these values.
My Graph is like this:
Code: Select all
Graph Item Data Source Name Graph Item Type Item Color
Item #1 peg_lnx_cpu_sys AREA 562B29
-Item #2 peg_lnx_cpu_sys: Current: GPRINT
-Item #3 peg_lnx_cpu_sys: Average:<HR> GPRINT
Item #4 peg_lnx_cpu_user STACK 4444FF
-Item #5 peg_lnx_cpu_user: Current: GPRINT
-Item #6 peg_lnx_cpu_user: Average:<HR> GPRINT
Item #7 peg_lnx_cpu_nice STACK CCBB00
-Item #8 peg_lnx_cpu_nice: Current: GPRINT
-Item #9 peg_lnx_cpu_nice: Average:<HR> GPRINT
Item #10 peg_lnx_cpu_idle STACK CDCFC4
-Item #11 peg_lnx_cpu_idle: Current: GPRINT
-Item #12 peg_lnx_cpu_idle: Average:<HR> GPRINT