help: cpu graph problem

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

Moderators: Developers, Moderators

Post Reply
baba
Posts: 2
Joined: Fri Feb 27, 2004 3:00 am
Location: Belgium

help: cpu graph problem

Post by baba »

I have got some problems with the cpu graphs . I would like to have CPU statistics about our Redhat web server(127.0.0.1 or 10.253.133.78) and we get nothing about it. We got just the processes and login number. With the memory, we don't have the right values... What's the problem? I hope someone can help me.

Thank you very much.

seb

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

Post by pbulteel »

If you could provide more information that would helpful. Like are you using SNMP, what version on your cacti server and on your web server. Are you using the templates in cacti or something else, etc.
uname -a
baba
Posts: 2
Joined: Fri Feb 27, 2004 3:00 am
Location: Belgium

help: cpu with cacti

Post by baba »

Hello! we use SNMP (net-snmp) version 5.1 and CACTI version 0.8.5 . We use the original templates and only the unix templates for the local server work... Can you help me to get the cpu information for my own server? What can I do?

Thank-you very much!

seb
User avatar
Morgan
Cacti User
Posts: 187
Joined: Wed Feb 25, 2004 3:38 am

Post by Morgan »

Code: Select all


#!/usr/local/bin/perl

$output = `/usr/local/net-snmp/bin/snmpget -Oav -v2c -c community $ARGV[0] .1.3.6.1.4.1.2021.10.1.3.2`;
$output =~ s/STRING: 0.//;
$output =~ s/STRING: 1.//;
#$output =~ s/\"|\.//g;
print $output;

this works for single cpu machines, it's a little bit iffy on multi cpu boxes.

then just create the necessary data input methings, you can add a variable to replace community with $ARGV[1] but make sure if you do that you create the input for the community in the data input method.
i'm attaching the templates i use, just import it. let me know if this helps.

Morgan
Attachments
cacti_graph_template_dns_cpu.xml
(7.69 KiB) Downloaded 236 times
seb

Post by seb »

I have tried this solutions but it doesn't send any informations about the cpu. I use redhat entreprise version 3 and perhaps the snmp installed is not well configured.If someone has a idea, let me know it...thank-you very much.


seb
Guest

Post by Guest »

Here's an updated version of that script that'll give you user, sys and idle times.

Code: Select all

#!/usr/bin/perl

%ids = (
        user => ".1.3.6.1.4.1.2021.11.9.0",
        sys => ".1.3.6.1.4.1.2021.11.10.0",
        idle => ".1.3.6.1.4.1.2021.11.11.0"
        );

while ( ($key, $value) = each %ids) {
        $output = `snmpget -Oav -v2c -c public $ARGV[0] $value`;
        chomp($output);
        $output =~ s/INTEGER: //;
        print "$key:".$output." ";
}
agismaniax
Posts: 5
Joined: Mon Jul 19, 2004 4:11 am
Contact:

Post by agismaniax »

melchandra
Cacti User
Posts: 311
Joined: Tue Jun 29, 2004 12:52 pm
Location: Indiana

Post by melchandra »

I am also running on a RedHat AS 3 box. All of the default unix templates work fine for me. I added the device, and set it's host template to "Local Linux Machine" All of it worked right out of the box. You shouldn't need extra scripts to graph cpu / memory usage. The memory usage by default does not take in to accout buffers that linux puts in memory. See http://www.raxnet.net/board/viewtopic.php?t=4335 for mor information on the memory scripts.
Dave
Coeus
Cacti User
Posts: 51
Joined: Mon Aug 04, 2003 8:46 pm
Location: Perth - Western Australia

Post by Coeus »

I dont think you have got snmp set up correctly.

Can you run an snmpwalk on the machine?

Carl
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests