Hi all,
at last I found a way to display the CPU-usage independent of the number of the installed CPU's.
Using another OID additionaly to the three already there in cacti:
.1.3.6.1.4.1.2021.11.50.0 (User)
.1.3.6.1.4.1.2021.11.51.0 (Nice)
.1.3.6.1.4.1.2021.11.52.0 (System)
.1.3.6.1.4.1.2021.11.53.0 (Idle - new)
These OID's exist in the ucd-snmp-MIB for linux. Under solaris they do not exist.
ToDo:
- Edit the DataTemplates for : ucd/net - CPU Usage - (System|User|Nice). Set the Maximum Value to 10000
- Add another DataTemplate (duplicate System) for Idle and use the OID above
- Add a CDEF:
Item #1 Special Data Source: CURRENT_DATA_SOURCE
Item #2 Special Data Source: ALL_DATA_SOURCES_NODUPS
Item #3 Operator: /
Item #4 Custom String: 100
Item #5 Operator: *
- In the GraphTemplate: delete the Line-definition and add the Idle-Datasource. It should look like that:
Item # 1 (cpu_system): System AREA AVERAGE
Item # 2 (cpu_system): Current: GPRINT LAST
Item # 3 (cpu_system): Average: GPRINT AVERAGE Item # 4 (cpu_system): Maximum:<HR> GPRINT MAX Item # 5 (cpu_user): User STACK AVERAGE Item # 6 (cpu_user): Current: GPRINT LAST
Item # 7 (cpu_user): Average: GPRINT AVERAGE Item # 8 (cpu_user): Maximum:<HR> GPRINT MAX Item # 9 (cpu_nice): Nice STACK AVERAGE
Item # 10 (cpu_nice): Current: GPRINT LAST
Item # 11 (cpu_nice): Average: GPRINT AVERAGE Item # 12 (cpu_nice): Maximum:<HR> GPRINT MAX Item # 13 (cpu_idle): Idle STACK AVERAGE Item # 14 (cpu_idle): Current: GPRINT LAST
Item # 15 (cpu_idle): Average: GPRINT AVERAGE Item # 16 (cpu_idle): Maximum: GPRINT MAX
Idle CPU Data Spurce
Nice CPU Data Source
System CPU Data Source
User CPU Data Source
- Set in every GraphTemplateItem the CDEF-Function you have defined before.
Hope it helps somebody
I can supply screenshots if necessary!
by
Stephan
CPU stats again with solution
Moderators: Developers, Moderators
I tried this on my laptop and it works better:
LPME:/var/www/php/cacti# snmpd -v
NET-SNMP version: 5.0.7
Web: http://www.net-snmp.org/
Email: net-snmp-coders@lists.sourceforge.net
In about 2 weeks I will be at work again and I check what version didn't work there.
I guess it s 5.0.8 and its Redhat 9.
BUT NOW when I exeute cmd.php I just don't get a result back:
snmp: 127.0.0.1:161, dsname: cpu_nice, oid: .1.3.6.1.4.1.2021.11.51.0, value:
snmp: 127.0.0.1:161, dsname: cpu_system, oid: .1.3.6.1.4.1.2021.11.52.0,
value:
snmp: 127.0.0.1:161, dsname: cpu_user, oid: .1.3.6.1.4.1.2021.11.50.0, value:
snmp: 127.0.0.1:161, dsname: cpu_idle, oid: .1.3.6.1.4.1.2021.11.53.0, value:
update /var/www/php/cacti/rra/localhost_cpu_nice_10.rrd --template cpu_nice N:U
update /var/www/php/cacti/rra/localhost_cpu_system_11.rrd --template cpu_system N:U
update /var/www/php/cacti/rra/localhost_cpu_user_12.rrd --template cpu_user N:U
update /var/www/php/cacti/rra/localhost_cpu_idle_13.rrd --template cpu_idle N:U
Why that?
PS: Localhost (127.0.0.1) SNMP Information
System: LINUX:LPME:2.4.23:#2:SMP:FRI:DEC:19:17:44:04:CETI686
Uptime: Timeticks: (945090) 2:37:30.90
Hostname: LPME
LPME:/var/www/php/cacti# snmpd -v
NET-SNMP version: 5.0.7
Web: http://www.net-snmp.org/
Email: net-snmp-coders@lists.sourceforge.net
In about 2 weeks I will be at work again and I check what version didn't work there.
I guess it s 5.0.8 and its Redhat 9.
BUT NOW when I exeute cmd.php I just don't get a result back:
snmp: 127.0.0.1:161, dsname: cpu_nice, oid: .1.3.6.1.4.1.2021.11.51.0, value:
snmp: 127.0.0.1:161, dsname: cpu_system, oid: .1.3.6.1.4.1.2021.11.52.0,
value:
snmp: 127.0.0.1:161, dsname: cpu_user, oid: .1.3.6.1.4.1.2021.11.50.0, value:
snmp: 127.0.0.1:161, dsname: cpu_idle, oid: .1.3.6.1.4.1.2021.11.53.0, value:
update /var/www/php/cacti/rra/localhost_cpu_nice_10.rrd --template cpu_nice N:U
update /var/www/php/cacti/rra/localhost_cpu_system_11.rrd --template cpu_system N:U
update /var/www/php/cacti/rra/localhost_cpu_user_12.rrd --template cpu_user N:U
update /var/www/php/cacti/rra/localhost_cpu_idle_13.rrd --template cpu_idle N:U
Why that?
PS: Localhost (127.0.0.1) SNMP Information
System: LINUX:LPME:2.4.23:#2:SMP:FRI:DEC:19:17:44:04:CETI686
Uptime: Timeticks: (945090) 2:37:30.90
Hostname: LPME
I had trouble with this as well. The changes that were necessary for me were:
1) Instead of 10000, I needed a max limit of 0. Some of the SNMP returned results are greater then 10^9!.
2) In the data templates, you must specify Data Source Type of GAUGE for all the "ucd/net - CPU Usage*" templates.
With those changes it works great! Thanks for posting the instructions!
1) Instead of 10000, I needed a max limit of 0. Some of the SNMP returned results are greater then 10^9!.
2) In the data templates, you must specify Data Source Type of GAUGE for all the "ucd/net - CPU Usage*" templates.
With those changes it works great! Thanks for posting the instructions!
Who is online
Users browsing this forum: No registered users and 3 guests