CPU Usage for Solaris

Templates, scripts for templates, scripts and requests for templates.

Moderators: Moderators, Developers

Author
Message
balint

CPU Usage for Solaris

#1 Post by balint » Tue Sep 07, 2004 5:23 am

The Default ucd/net - CPU Usage graph and data template extension for Solaris enviroment
Attachments
cacti_graph_template_cpu_usage_by_balint_2.xml
(28.16 KiB) Downloaded 6045 times
cpu_usage.png
screenshot
cpu_usage.png (9.45 KiB) Viewed 73011 times

Guest

#2 Post by Guest » Mon Nov 01, 2004 5:48 pm

I get this error when trying to run that:


Notice: Undefined index: oid_index in /home/cacti/html/cacti/lib/data_query.php on line 129

Notice: Undefined index: oid_index in /home/cacti/html/cacti/lib/data_query.php on line 131

Warning: Variable passed to each() is not an array or object in /home/cacti/html/cacti/lib/data_query.php on line 141

Warning: Cannot modify header information - headers already sent by (output started at /home/cacti/html/cacti/lib/data_query.php:129) in /home/cacti/html/cacti/host.php on line 92



anyone have an idea? I am using 0.8.5 and tryed this on solaris and redhat

vishalsngh
Posts: 8
Joined: Thu Jan 27, 2005 2:12 pm

#3 Post by vishalsngh » Sat Jan 29, 2005 1:48 pm

Hi
i am looking for a similar solution for monitoring my 200 Solaris 8 boxes. Just clarify one thing, do i need to install net-snmp on solaris or the default sun snmp agent will do?

cih
Posts: 3
Joined: Mon Feb 07, 2005 12:21 pm

#4 Post by cih » Mon Feb 07, 2005 12:26 pm

Hi!

Was looking to implement this on my SUN server as a client to get these monitoring in my linux monitor box. I'm doing snmpwalk like this over the SUN server from my linux monitoring box:

[[email protected] root]# snmpget -v1 -c user1 xxx.xxx.xxx.xxx .1.3.6.1.4.1.2021.11.53.0
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: UCD-SNMP-MIB::ssCpuRawIdle.0

[[email protected] root]# snmpget -v1-c user1 xxx.xxx.xxx.xxx .1.3.6.1.4.1.2021.11.55.0
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: UCD-SNMP-MIB::ssCpuRawKernel.0

[[email protected] root]# snmpget -v1 -c user1 xxx.xxx.xxx.xxx .1.3.6.1.4.1.2021.11.52.0
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: UCD-SNMP-MIB::ssCpuRawSystem.0

[[email protected] root]# snmpget -v1 -c user1 xxx.xxx.xxx.xxx .1.3.6.1.4.1.2021.11.50.0
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: UCD-SNMP-MIB::ssCpuRawUser.0

[[email protected] root]# snmpget -v1 -c user1 xxx.xxx.xxx.xxx .1.3.6.1.4.1.2021.11.54.0
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: UCD-SNMP-MIB::ssCpuRawWait.0

Tried to do snmpwalk from my SUN server directly, and no luck at all. Do I need to do something special on my SUN server SNMP configuration to view that MIB?

Thanks for the help!

User avatar
hbokh
Posts: 40
Joined: Thu Feb 24, 2005 4:29 pm
Location: Groningen, NL

#5 Post by hbokh » Tue Mar 08, 2005 11:06 am

Works fine with SMCnsnmp 5.1.1 on Solaris 8 (Sparc) here.
Looks even better than the Cacti included 'CPU Usage" :D
This is my sick nature...

cih
Posts: 3
Joined: Mon Feb 07, 2005 12:21 pm

#6 Post by cih » Tue Mar 08, 2005 12:25 pm

Hi hbokh!

I'm working with the same netsnmp version (5.1.1), with openssl 0.9.7d, and libgcc 3.4.1. No luck at all in Solaris 8 and Solaris 9. Same problem in two servers ... returning as follows:

Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: UCD-SNMP-MIB::ssCpuRawIdle.0

Am I missing anything else?¿ SNMP special configuration needed?¿ Any MIB I don't have in my servers?¿

TIA.

pbulteel
Cacti User
Posts: 150
Joined: Fri Sep 05, 2003 9:20 am
Location: London
Contact:

#7 Post by pbulteel » Tue Mar 08, 2005 12:43 pm

Can you use the standard snmp template and get cpu usage from that?

-P
uname -a

dgamble
Cacti User
Posts: 68
Joined: Tue Mar 08, 2005 4:50 pm
Location: Calgary, AB, CA

Working Solaris config

#8 Post by dgamble » Tue Mar 08, 2005 5:08 pm

Hey all, this is my first post on the forum. Sorry if this is mentioned anywhere else.

I've set up Cacti on both Solaris and Linux with a 2.6 kernel.

The included CPU usage graphs don't break down CPU properly for either, although mostly because the wrong items are tallied up. It would work fine on a Linux 2.4 kernel.

I made copies of the included graph template, added the new data sources, and then changed one template to run with Linux 2.6, and the other for Solaris (and added a new host template). I also added Idle time to the graph, which is mostly useful for seeing when here are problems collecting the CPU data, and/or to see if your values are wrong. Yes, you'll need net-snmp. On Solaris, you can either replace the existing Solaris agent, or just run one on a different port.

For Linux 2.6, you will need to graph:

Idle CPU Data Source (if you want it)
Nice CPU Data Source
System CPU Data Source
User CPU Data Source
Wait CPU Data Source

For Solaris, you will need to graph:

Idle CPU Data Source (if you want it)
Kernel CPU Data Source
User CPU Data Source
Wait CPU Data Source

DON'T graph both kernel and system CPU. On Solaris, "system" CPU is just "kernel" and "wait" added together. On Linux 2.6, "kernel" is ... "system" and "idle", I think? So, including both will cause your non-idle time to be inaccurate.

ALSO, note that the figures are NOT percentages, as the graph suggests. They are ticks per second, as reported by the kernel. This is most noticable with a multi-CPU Linux 2.6 kernel machine, where your total ticks will be 100xProcessors. If you have a single processor Linux machine, or a Solaris machine, then they will just appear to be percentages as the kernel will tally ticks at 100 per second.

Hope this helps!

User avatar
brutus
Posts: 1
Joined: Wed Mar 09, 2005 12:50 pm

#9 Post by brutus » Wed Mar 09, 2005 12:52 pm

hi,
is there a chance to have a template which graph charge for each processor ?
thanks for answer

uwo_nms
Posts: 2
Joined: Sun Mar 06, 2005 10:03 pm

#10 Post by uwo_nms » Wed Mar 09, 2005 10:06 pm

I've got same problem with :

snmpget -v1 -c yyyyy xxxxx .1.3.6.1.4.1.2021.11.54.0

Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: UCD-SNMP-MIB::ssCpuRawWait.0

The MIB doesnt have it.

what should I do?

User avatar
hbokh
Posts: 40
Joined: Thu Feb 24, 2005 4:29 pm
Location: Groningen, NL

#11 Post by hbokh » Thu Mar 10, 2005 8:09 am

Hi cih,

When you run this command

Code: Select all

snmpwalk -v 2c -c public -m ALL localhost .1.3 > SNMP.txt
is there anything like this?

Code: Select all

# grep Cpu SNMP.txt 
UCD-SNMP-MIB::ssCpuUser.0 = INTEGER: 8
UCD-SNMP-MIB::ssCpuSystem.0 = INTEGER: 7
UCD-SNMP-MIB::ssCpuIdle.0 = INTEGER: 86
UCD-SNMP-MIB::ssCpuRawUser.0 = Counter32: 1453570
UCD-SNMP-MIB::ssCpuRawSystem.0 = Counter32: 10130334
UCD-SNMP-MIB::ssCpuRawIdle.0 = Counter32: 448662615
UCD-SNMP-MIB::ssCpuRawWait.0 = Counter32: 2696585
UCD-SNMP-MIB::ssCpuRawKernel.0 = Counter32: 7433749
If not, is there a file called /usr/local/share/snmp/mibs/UCD-SNMP-MIB.txt
on your system (readable, etc.)?

Notice the -v 2c !! I also run SNMP v2 in Cacti.

Cheers, Henk
This is my sick nature...

dgamble
Cacti User
Posts: 68
Joined: Tue Mar 08, 2005 4:50 pm
Location: Calgary, AB, CA

CPU stats - templates

#12 Post by dgamble » Thu Mar 10, 2005 6:17 pm

hbokh wrote:Hi cih,

When you run this command

Code: Select all

snmpwalk -v 2c -c public -m ALL localhost .1.3 > SNMP.txt
is there anything like this?

Code: Select all

# grep Cpu SNMP.txt 
UCD-SNMP-MIB::ssCpuUser.0 = INTEGER: 8
UCD-SNMP-MIB::ssCpuSystem.0 = INTEGER: 7
UCD-SNMP-MIB::ssCpuIdle.0 = INTEGER: 86
UCD-SNMP-MIB::ssCpuRawUser.0 = Counter32: 1453570
UCD-SNMP-MIB::ssCpuRawSystem.0 = Counter32: 10130334
UCD-SNMP-MIB::ssCpuRawIdle.0 = Counter32: 448662615
UCD-SNMP-MIB::ssCpuRawWait.0 = Counter32: 2696585
UCD-SNMP-MIB::ssCpuRawKernel.0 = Counter32: 7433749
If not, is there a file called /usr/local/share/snmp/mibs/UCD-SNMP-MIB.txt
on your system (readable, etc.)?

Notice the -v 2c !! I also run SNMP v2 in Cacti.

Cheers, Henk
Just a note to everyone doing this- not all of these CPU values are present on a given architecture. For example, Linux 2.6 will have "nice" CPU, but Solaris does not. And, not all versions of net-snmp have support for them.

I've attached both of my graph templates, so people can try them out.

One note for these graphs is that they shows CPU in ticks, not percentages. I prefer it this way because timing of when each data source is collected (for a machine which usage fluctuates) can cause the sum of the data to be higher or lower than 100 t/s (or more, for some multi-CPU systems), and making the data into a percentage could make the values incorrect. If you do want percentages, you can just make a CDEF.
Attachments
cacti_graph_template_ucdnet_cpu_usage_linux_2_6.xml
ucd/net - CPU Usage - Linux 2.6
(28.08 KiB) Downloaded 2442 times
cacti_graph_template_ucdnet_cpu_usage_solaris.xml
ucd/net - CPU Usage - Solaris
(23.41 KiB) Downloaded 4138 times

cih
Posts: 3
Joined: Mon Feb 07, 2005 12:21 pm

#13 Post by cih » Mon Mar 21, 2005 7:05 am

Hi hbokh!

When I run snmpwalk -v 2c -c public -m ALL localhost .1.3 > SNMP.txt in my Solaris 8 or Solaris 9 boxes, result is:

Timeout: No Response from localhost.

File /usr/local/share/snmp/mibs/UCD-SNMP-MIB.txt exists and is readable for all.

Is posible version 2c is not running?¿ I can`t get anything from version 2c ... Am I missing something in my snmp config?

stigmata
Posts: 45
Joined: Tue Nov 23, 2004 10:26 am

#14 Post by stigmata » Tue May 10, 2005 7:08 am

Hi dgamble,

thx for your great CPU-Script. I use the one for the 2.6 linux kernel. It works great but one thing, I get a "nan" at the "Wait" value (but this is very importend for me :)).

What can I do?

Regards,
Oliver

dgamble
Cacti User
Posts: 68
Joined: Tue Mar 08, 2005 4:50 pm
Location: Calgary, AB, CA

#15 Post by dgamble » Tue May 10, 2005 7:24 am

stigmata wrote:Hi dgamble,

thx for your great CPU-Script. I use the one for the 2.6 linux kernel. It works great but one thing, I get a "nan" at the "Wait" value (but this is very importend for me :)).

What can I do?

Regards,
Oliver
I believe that net-snmp returns that object only as of version 5.2, which is probably the issue.

Post Reply