[HOWTO] Install and configure the Net-SNMP agent for Unix

If you figure out how to do something interesting/cool in Cacti and want to share it with the community, please post your experience here.

Moderators: Moderators, Developers

Author
Message
User avatar
fmangeant
Cacti Guru User
Posts: 2326
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

[HOWTO] Install and configure the Net-SNMP agent for Unix

#1 Post by fmangeant » Thu Aug 10, 2006 9:53 am

This HowTo is now available at docs.cacti.net !

  • Version 0.7.8 (06/15/2017) : new website for AIX packages
  • Version 0.7.7 (10/31/2008) : security advisory
  • Version 0.7.6 (06/11/2008) : security advisory
  • Version 0.7.5 (02/01/2008) : updated the AIX links
  • Version 0.7.4 (01/31/2008) : added links for Mac OS X
  • Version 0.7.3 (01/29/2008) : updated the Solaris links
  • Version 0.7.2 (12/04/2007) : list CentOS as RedHat / Fedora compatible (thanks to bennett)
  • Version 0.7.1 (11/26/2007) : add an option to graph I/O usage under Gentoo Linux
  • Version 0.7 (02/16/2007) : count entries in logfiles (thanks to gerdesj)
  • Version 0.6 (11/02/2006) : added the "dontPrintUnits" keyword (thanks to netpoke2369)
  • Version 0.5 (09/22/2006) : graph processes
  • Version 0.4 (08/30/2006) : make Net-SNMP listens on TCP, and bind to a specific IP address
  • Version 0.3 (08/14/2006) : build from sources instructions
  • Version 0.2 (08/11/2006) : added SNMP version 3, "exec" and "proxy" directives
  • Version 0.1 (08/10/2006) : intial release


This HowTo will explain how to install and configure the Net-SNMP agent. As the time of writing, the latest version available is 5.7.3 (published on 12/08/2014).


Chapter I: Getting Net-SNMP binaries

Depending on your operating system, you'll find packages or tarballs to install Net-SNMP :
Chapter II: Building the Net-SNMP agent from sources

If you can't find binaries for your architecture, you can build the Net-SNMP agent from sources. Latest sources are available here.

Here's how to get the configure options of an already running Net-SNMP agent :

Code: Select all

$ snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.100.6.0
UCD-SNMP-MIB::versionConfigureOptions.0 = STRING: "'-disable-shared' '--with-mib-modules=host/hr_system'"
Some useful mib modules are :
  • mibII/mta_sendmail, to graph MTA (Sendmail, Postfix, etc.) statistics
  • diskio, to enable to graph I/O statistics
  • ucd-snmp/lmSensors, for hardware monitoring (Linux and Solaris only)
Mib modules can be added like this :

Code: Select all

$ ./configure --with-mib-modules="module1 module2"
To compile Net-SNMP and build a compressed archive, follow these steps :

Code: Select all

$ ./configure --with-your-options
$ make
# mkdir /usr/local/dist
# make install prefix=/usr/local/dist/usr/local exec_prefix=/usr/local/dist/usr/local
# cd /usr/local/dist
# tar cvf /tmp/net-snmp-5.3.1-dist.tar usr
# gzip /tmp/net-snmp-5.3.1-dist.tar
# rm -rf /usr/local/dist
You can then copy the /tmp/net-snmp-5.3.1-dist.tar.gz file to other servers, and uncompress it from the root directory (everything will get extracted to /usr/local).



Chapter III: Configuring the Net-SNMP agent

Depending on how you've installed Net-SNMP, the main configuration file (snmpd.conf) is located in /etc/snmp (installation from package) or /usr/local/share/snmp (installation from tarball).

Please note that you need to restart (or send the HUP signal) the snmpd daemon whenever you modify snmpd.conf !

The minimum configuration is this one :

Code: Select all

rocommunity public
This will enable SNMP version 1/2 read-only requests from any host, with the community name public.
With this minimal configuration, you'll be able to graph CPU usage, load average, network interfaces, memory / swap usage, logged in users and number of processes.

You can restrict from which hosts SNMP queries are allowed :

Code: Select all

rocommunity public 127.0.0.1
rocommunity test 87.65.43.21
By default Net-SNMP listens on UDP port 161 on all IPv4 interfaces.
With the following example, Net-SNMP will listen on UDP port 10000 on 10.20.30.40 IP address :

Code: Select all

agentaddress 10.20.30.40:10000
You can also make it listens on TCP, which is supported by Cacti :

Code: Select all

agentaddress tcp:161
The "tcp" keyword can then be used in Cacti :
Image


For those who want some more security, you can use the SNMP version 3 protocol, with MD5 or SHA hashing :

Code: Select all

createUser frederic MD5 mypassphrase DES
group groupv3             usm      frederic
view    all included   .iso      80
access groupv3         ""        any       auth      exact    all         all        all
This creates a user "frederic" whose password is "mypassphrase". To test it :

Code: Select all

# snmpget -v 3 -l AuthNoPriv -u frederic -A mypassphrase 10.50.80.45 sysName.0
SNMPv2-MIB::sysName.0 = STRING: cyclopes
In Cacti, add your device, choose SNMP version 3, and fill the username and password fields :

Image


Now that you're done with access control, add these 2 lines in snmpd.conf to indicate the location and contact name of your device :

Code: Select all

syslocation Bat. C2
syscontact [email protected]
They will then appear in Cacti management interface :

Image

Some OIDs return a unit, eg "-153 0.1 dBm".
It's a safe idea to turn this off, by adding this to snmpd.conf :

Code: Select all

dontPrintUnits true

Next step is to graph filesystems in Cacti; the easyest way is to add this line in snmpd.conf :

Code: Select all

includeAllDisks
When you'll run the "ucd/net - Get Monitored Partitions" Data Query, all the mounted filesystems will show up :

Image

If you want a filesystem not to be listed here, add this line to snmpd.conf :

Code: Select all

ignoredisk /dev/rdsk/c0t2d0
Unfortunatly, some older versions of Net-SNMP do not fully work with the includeAllDisks keyword :-?
You'll then have to list explicitly all filesystems you want to graph :

Code: Select all

disk /
disk /usr
disk /var
disk /oracle
You can also specify NFS mount points.

Please note that the Net-SNMP agent can only report filesystems which where mounted before its start.
If you manually mount filesystems later, you'll have to reload the Net-SNMP agent (send the HUP signal).


You can also graph processes, by adding this to snmpd.conf :

Code: Select all

proc httpd
The result will be accessible under the ucdavis.prTable.prEntry tree :
  • prCount, number of current processes running with the name in question
  • prNames, the process name you're counting.
In our example, the number of Apache processes will be available under the .1.3.6.1.4.1.2021.2.1.5 OID



Chapter IV: Test your configuration

Once Net-SNMP is configured and started, here's how to test it :

Code: Select all

$ snmpwalk -v 1 -c public localhost .1.3.6.1.2.1.1.1.0
SNMPv2-MIB::sysDescr.0 = STRING: Linux cronos 2.4.28 #2 SMP ven jan 14 14:12:01 CET 2005 i686
This basic query shows that your Net-SNMP agent is reachable.

You can even query which Net-SNMP version is running on a host :

Code: Select all

$ snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.100.2.0
UCD-SNMP-MIB::versionTag.0 = STRING: 5.2.1.2
An answer like that one

Code: Select all

$ snmpwalk -v 1 -c foo localhost .1.3.6.1.2.1.1.1.0
Timeout: No Response from localhost
indicates that either the agent is not started, or that the community string is incorrect, or that this device is unreachable.
Check your community string, add firewall rules if necessary, etc.

If using SNMP version 3, specifying an unknown user will result in this error message :

Code: Select all

$ snmpget -v 3 -l AuthNoPriv -u john -A mypassphrase 10.50.80.45 sysName.0
snmpget: Unknown user name
An incorrect passphrase will result in this error message :

Code: Select all

$ snmpget -v 3 -l AuthNoPriv -u frederic -A badpassphrase 10.50.80.45 sysName.0
snmpget: Authentication failure (incorrect password, community or key)
This query will show you what filesystems are mounted :

Code: Select all

$ snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.9.1.2
UCD-SNMP-MIB::dskPath.1 = STRING: /
UCD-SNMP-MIB::dskPath.2 = STRING: /BB
UCD-SNMP-MIB::dskPath.3 = STRING: /dev/shm
If the answer is empty, usually it means the includeAllDisks is not supported by your Net-SNMP agent (you'll have to list each filesystem you want to graph as explained in previous chapter).

Finally, this query will you display your network interfaces :

Code: Select all

$ snmpwalk -v 1 -c public localhost .1.3.6.1.2.1.2.2.1.2
IF-MIB::ifDescr.1 = STRING: lo
IF-MIB::ifDescr.2 = STRING: eth0
IF-MIB::ifDescr.3 = STRING: eth1

Chapter V: Extending the Net-SNMP agent

A great functionnality of Net-SNMP is that you can "extend" it.

Let's run the /tmp/foo.sh script :

Code: Select all

$ /tmp/foo.sh -arg1
123
Now put this in snmpd.conf :

Code: Select all

exec foo /bin/sh /tmp/foo.sh -arg1
The result of your script will be accessible under the ucdavis.extTable.extEntry tree :
  • output of the script : ucdavis.extTable.extEntry.extOutput
  • exit status : ucdavis.extTable.extEntry.extResult
  • command : ucdavis.extTable.extEntry.extCommand
You can check the result with this SNMP query :

Code: Select all

$ snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.8.1
UCD-SNMP-MIB::extIndex.1 = INTEGER: 1
UCD-SNMP-MIB::extNames.1 = STRING: foo
UCD-SNMP-MIB::extCommand.1 = STRING: /bin/sh /tmp/foo.sh -arg1
UCD-SNMP-MIB::extResult.1 = INTEGER: 0
UCD-SNMP-MIB::extOutput.1 = STRING: 123
UCD-SNMP-MIB::extErrFix.1 = INTEGER: 0
UCD-SNMP-MIB::extErrFixCmd.1 = STRING:
extOutput translates to .1.3.6.1.4.1.2021.8.1.101
As "foo" is our first exec directive, add ".1" at the end of the OID.

In Cacti, use the "SNMP - Generic OID Template" like this :
Image
Voila ! Result of the /tmp/foo.sh script is now graphed in Cacti.


Now let's run this second script, which returns more than one result :

Code: Select all

$ /tmp/bar.sh
456
789
It returns two values, one per line (this is important).

Another way to call scripts from snmpd.conf is by specifying an OID, like this :

Code: Select all

exec .1.3.6.1.4.1.2021.555 /bin/sh /tmp/bar.sh
Run this query :

Code: Select all

$ snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.555
UCD-SNMP-MIB::ucdavis.555.1.1 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.555.2.1 = STRING: "/bin/sh"
UCD-SNMP-MIB::ucdavis.555.3.1 = STRING: "/tmp/bar.sh"
UCD-SNMP-MIB::ucdavis.555.100.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.555.101.1 = STRING: "456"
UCD-SNMP-MIB::ucdavis.555.101.2 = STRING: "789"
UCD-SNMP-MIB::ucdavis.555.102.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.555.103.1 = ""
First line returned by the script will be available at .1.3.6.1.4.1.2021.555.101.1, second one at .1.3.6.1.4.1.2021.555.101.2, and so on.

You can then use the "SNMP - Generic OID Template" in Cacti (one Data Source per OID).




Let's say you want to count the number of entries in a log file.
Add this to snmpd.conf :

Code: Select all

logmatch cactistats /home/cactiuser/cacti/log/cacti.log 120 SYSTEM STATS
  • the global count of matches will be available under the .1.3.6.1.4.1.2021.16.2.1.5.1 OID
  • the "Regex match counter" (which is reset with each file rotation) will be available under the .1.3.6.1.4.1.2021.16.2.1.7.1 OID
To list all the available variables, use this query :

Code: Select all

$ snmpwalk -v 1 -c public localhost logMatch
UCD-SNMP-MIB::logMatchMaxEntries.0 = INTEGER: 50
UCD-SNMP-MIB::logMatchIndex.1 = INTEGER: 1
UCD-SNMP-MIB::logMatchName.1 = STRING: cactistats
UCD-SNMP-MIB::logMatchFilename.1 = STRING: /home/cactiuser/cacti/log/cacti.log
UCD-SNMP-MIB::logMatchRegEx.1 = STRING: SYSTEM STATS
UCD-SNMP-MIB::logMatchGlobalCounter.1 = Counter32: 301634
UCD-SNMP-MIB::logMatchGlobalCount.1 = INTEGER: 301634
UCD-SNMP-MIB::logMatchCurrentCounter.1 = Counter32: 6692
UCD-SNMP-MIB::logMatchCurrentCount.1 = INTEGER: 6692
UCD-SNMP-MIB::logMatchCounter.1 = Counter32: 1
UCD-SNMP-MIB::logMatchCount.1 = INTEGER: 0
UCD-SNMP-MIB::logMatchCycle.1 = INTEGER: 120
UCD-SNMP-MIB::logMatchErrorFlag.1 = INTEGER: 0
UCD-SNMP-MIB::logMatchRegExCompilation.1 = STRING: Success


We'll then use another interesting directive, the "proxy" one.
Let's take for example the Squid proxy : when enabled, its SNMP agent listen to UDP 3401 port.
If you want to have system graphs and Squid graphs without declaring 2 devices in Cacti, add this in snmpd.conf :

Code: Select all

proxy -v 1 -c public localhost:3401 .1.3.6.1.4.1.3495.1
The Squid SNMP tree will be available under the .1.3.6.1.4.1.3495.1 branch.

Let's query this host :

Code: Select all

$ snmpwalk -v 1 -c public 10.151.33.3 sysdescr
SNMPv2-MIB::sysDescr.0 = STRING: Linux srv1.foo.com 2.6.8.1-12mdk #1 Fri Oct 1 12:53:41 CEST 2004 i686
And here's the Squid part (this specific OID returns the Squid version) :

Code: Select all

$ snmpwalk -v 1 -c public 10.151.33.3 .1.3.6.1.4.1.3495.1.2.3.0
SNMPv2-SMI::enterprises.3495.1.2.3.0 = STRING: "2.5.STABLE6"
You'll find how to enable the Squid SNMP agent here.
Last edited by fmangeant on Tue Sep 29, 2009 9:13 am, edited 25 times in total.
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]

User avatar
rony
Developer/Forum Admin
Posts: 6016
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

#2 Post by rony » Sun Aug 13, 2006 10:19 am

I like how-to's.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]

roli8200
Posts: 2
Joined: Sun Aug 20, 2006 7:04 am

No snmp access at all

#3 Post by roli8200 » Sun Aug 20, 2006 7:08 am

Hello

Sorry, but I cant snmp get working on suse 10.1 machine. I've installed serveral snmp agents on fedora machines without any problem but here I only access the snmp server from the local machine. iptables completeley disabled (-P INPUT ACCEPT, -P OUTPUT ACCEPT (-F -X)) and this configuration settings:

# Security
com2sec local localhost public
com2sec network 87.245.0.0/16 public

#Security Group / Name interchange
# Gruppe Modell Security-Name
group rwGroup v1 local
group rwGroup v2c local
group rwGroup usm local
group rwGroup v1 network
group rwGroup v2c network
group rwGroup usm network

#Views
# Name Typ Unterbaum
view all included .1

#Access Control
# Gruppe Kontext Modell Level Praefix Lesen Schreiben Nachricht
access rwGroup "" any noauth exact all all none

the snmpwalk -v1 -c public localhost system works only on the same machine. As soon as I try to access it from a other machine inside 87.245.0.0 network I get the already known error:
Timeout: No Response from 87.245.90.23
Has SuSE some special configuration I should know. Is there any additional debuging prossibiliy other than the log level of the snmpd?

Any help whould be very welcome.

Thanks

Roland Kaeser

User avatar
fmangeant
Cacti Guru User
Posts: 2326
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

#4 Post by fmangeant » Mon Aug 21, 2006 3:00 am

Hi

I copied/pasted your snmpd.conf file, replaced 87.245.0.0/16 with 10.50.80.0/24, restarted Net-SNMP and it works from a host in this range...

Can you check that Net-SNMP listens to all interfaces :

Code: Select all

$ netstat -nl | grep 161
udp        0      0 0.0.0.0:161             0.0.0.0:*
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]

carpenike
Posts: 6
Joined: Mon Jun 19, 2006 8:05 am

#5 Post by carpenike » Sun Aug 27, 2006 2:32 am

Try adding this to your snmpd.conf:

agentaddress

User avatar
fmangeant
Cacti Guru User
Posts: 2326
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

#6 Post by fmangeant » Wed Aug 30, 2006 2:54 am

Hi

I've added a note about agentaddress, thanks for noticing this.
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]

kamina
Posts: 28
Joined: Tue Aug 22, 2006 3:19 am

#7 Post by kamina » Tue Sep 05, 2006 4:11 am

Nice howto, but I'm not getting it to work :)

Both machines are running Centos 4.x

Code: Select all

rocommunity public 193.94.143.0/24

# Machine location and contact
syslocation 5th floor
syscontact [email protected]

# Include information on all mounted disks on the server

disk /
disk /boot
disk /home
disk /var
Just testing a very basic setup to use as a template before getting into user authentication.

For example the cpu-usage graph shows readings between 600-800m (million?)

Code: Select all

$ snmpwalk -v2c -c public jazz .1.3.6.1.4.1.2021.11.50.0
UCD-SNMP-MIB::ssCpuRawUser.0 = Counter32: 580408

$ snmpwalk -v2c -c public jazz .1.3.6.1.4.1.2021.11.51.0
UCD-SNMP-MIB::ssCpuRawNice.0 = Counter32: 36
Disks and memory seem to be showing the correct values, but load is showing the cacti hosts load:

Code: Select all

$ snmpwalk -v2c -c public jazz .1.3.6.1.4.1.2021.10.1.3.1
UCD-SNMP-MIB::laLoad.1 = STRING: 1.41
Shows the correct value.

I would also be intrested in graphing io-wait if possible. Doing an snmp-walk I found the following:

Code: Select all

UCD-SNMP-MIB::ssIOSent.0 = INTEGER: 1
UCD-SNMP-MIB::ssIOReceive.0 = INTEGER: 1
UCD-SNMP-MIB::ssSysInterrupts.0 = INTEGER: 7
But maby I need something else?

User avatar
fmangeant
Cacti Guru User
Posts: 2326
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

#8 Post by fmangeant » Tue Sep 05, 2006 7:17 am

Hi
kamina wrote:For example the cpu-usage graph shows readings between 600-800m (million?)
600m means 0.600 : http://forums.cacti.net/viewtopic.php?t=8168

The default templates provided with Cacti are made for 1 CPU systems.
You can use my templates for 2, 4 or 8 CPU systems : http://forums.cacti.net/viewtopic.php?t=15412
kamina wrote:Disks and memory seem to be showing the correct values, but load is showing the cacti hosts load:
Strange... Can you check that running "w" on the target server is the same as querying the "latable" OID ?
kamina wrote:I would also be intrested in graphing io-wait if possible. Doing an snmp-walk I found the following:

Code: Select all

UCD-SNMP-MIB::ssIOSent.0 = INTEGER: 1
UCD-SNMP-MIB::ssIOReceive.0 = INTEGER: 1
UCD-SNMP-MIB::ssSysInterrupts.0 = INTEGER: 7
You can use the following OIDs :

Code: Select all

$ snmpwalk -v 1 -c public localhost systemStats | grep ssCpuRaw
UCD-SNMP-MIB::ssCpuRawUser.0 = Counter32: 340088819
UCD-SNMP-MIB::ssCpuRawNice.0 = Counter32: 369055
UCD-SNMP-MIB::ssCpuRawSystem.0 = Counter32: 84007851
UCD-SNMP-MIB::ssCpuRawIdle.0 = Counter32: 1787948197
UCD-SNMP-MIB::ssCpuRawWait.0 = Counter32: 97863793
UCD-SNMP-MIB::ssCpuRawKernel.0 = Counter32: 78997557
UCD-SNMP-MIB::ssCpuRawInterrupt.0 = Counter32: 913566
UCD-SNMP-MIB::ssCpuRawSoftIRQ.0 = Counter32: 4096728
They are all counters; you can use the "ucd/net" CPU templates as a model.
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]

kamina
Posts: 28
Joined: Tue Aug 22, 2006 3:19 am

#9 Post by kamina » Tue Sep 05, 2006 3:06 pm

fmangeant wrote: Strange... Can you check that running "w" on the target server is the same as querying the "latable" OID ?
Thanks for the fast reply. I hope I understood what you where getting at. Here is almost simultanious on the cacti host and target.

target:

Code: Select all

$ w
 23:04:07 up 11 days, 14:04,  1 user,  load average: 1.40, 1.35, 1.26
USER     TTY      FROM              [email protected]   IDLE   JCPU   PCPU WHAT
mikaa    pts/0    carmen.example.com 23:02    1.00s  0.01s  0.00s w
cacti host:

Code: Select all

$ snmpwalk -v 2c -c public jazz latable
UCD-SNMP-MIB::laIndex.1 = INTEGER: 1
UCD-SNMP-MIB::laIndex.2 = INTEGER: 2
UCD-SNMP-MIB::laIndex.3 = INTEGER: 3
UCD-SNMP-MIB::laNames.1 = STRING: Load-1
UCD-SNMP-MIB::laNames.2 = STRING: Load-5
UCD-SNMP-MIB::laNames.3 = STRING: Load-15
UCD-SNMP-MIB::laLoad.1 = STRING: 1.40
UCD-SNMP-MIB::laLoad.2 = STRING: 1.35
UCD-SNMP-MIB::laLoad.3 = STRING: 1.26
UCD-SNMP-MIB::laConfig.1 = STRING: 12.00
UCD-SNMP-MIB::laConfig.2 = STRING: 12.00
UCD-SNMP-MIB::laConfig.3 = STRING: 12.00
UCD-SNMP-MIB::laLoadInt.1 = INTEGER: 139
UCD-SNMP-MIB::laLoadInt.2 = INTEGER: 135
UCD-SNMP-MIB::laLoadInt.3 = INTEGER: 126
UCD-SNMP-MIB::laLoadFloat.1 = Opaque: Float: 1.400000
UCD-SNMP-MIB::laLoadFloat.2 = Opaque: Float: 1.350000
UCD-SNMP-MIB::laLoadFloat.3 = Opaque: Float: 1.260000
UCD-SNMP-MIB::laErrorFlag.1 = INTEGER: 0
UCD-SNMP-MIB::laErrorFlag.2 = INTEGER: 0
UCD-SNMP-MIB::laErrorFlag.3 = INTEGER: 0
UCD-SNMP-MIB::laErrMessage.1 = STRING: 
UCD-SNMP-MIB::laErrMessage.2 = STRING: 
UCD-SNMP-MIB::laErrMessage.3 = STRING: 
Looks like it matches?

edit:

For comparison, here is what I have on the cacti host, and this is what I'm seeing on my graph:

Code: Select all

$ w
 23:07:16 up 15 days, 11:39,  3 users,  load average: 4.87, 2.72, 2.93
USER     TTY      FROM              [email protected]   IDLE   JCPU   PCPU WHAT
root     :0       -                21Aug06 ?xdm?  44:19m  0.67s /usr/bin/gnome-session
root     pts/1    :0.0             21Aug06 11days 59.92s 59.92s bash
mikaa    pts/2    carmen.example.com 23:00    0.00s  0.11s  0.03s w
It's an old computer that I'm using for testing, the loads are like this all the time :D It's very easy to spot the differance between the two.

User avatar
fmangeant
Cacti Guru User
Posts: 2326
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

#10 Post by fmangeant » Wed Sep 06, 2006 2:47 am

kamina wrote:Looks like it matches?
Yup :)
kamina wrote:For comparison, here is what I have on the cacti host, and this is what I'm seeing on my graph:
Are you using the "Unix - Load Average" graph template ?

If yes, try the "ucd/net - Load Average" one instead.
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]

kamina
Posts: 28
Joined: Tue Aug 22, 2006 3:19 am

#11 Post by kamina » Wed Sep 06, 2006 3:36 am

I was using the ucd/net - load averige. I deleted it, and added again, I'll see if it affects the outcome.

kamina
Posts: 28
Joined: Tue Aug 22, 2006 3:19 am

#12 Post by kamina » Wed Sep 06, 2006 9:16 am

No help, it's still showiing the cacti hosts load.

Image

Don't know if this is any use, but the graph debug info:

Code: Select all

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Jazz - Vmware Host - Load Average" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--units-exponent=0 \
--vertical-label="processes in the run queue" \
--slope-mode \
DEF:a="/var/www/cacti/rra/jazz_vmware_host_load_1min_89.rrd":load_1min:AVERAGE \
DEF:b="/var/www/cacti/rra/jazz_vmware_host_load_5min_91.rrd":load_5min:AVERAGE \
DEF:c="/var/www/cacti/rra/jazz_vmware_host_load_15min_90.rrd":load_15min:AVERAGE \
CDEF:cdefg=TIME,1157551723,GT,a,a,UN,0,a,IF,IF,TIME,1157551723,GT,b,b,UN,0,b,IF,IF,TIME,1157551723,GT,c,c,UN,0,c,IF,IF,+,+ \
AREA:a#EACC00:"1 Minute Average"  \
GPRINT:a:LAST:" Current\:%8.2lf\n"  \
AREA:b#EA8F00:"5 Minute Average":STACK \
GPRINT:b:LAST:" Current\:%8.2lf\n"  \
AREA:c#FF0000:"15 Minute Average":STACK \
GPRINT:c:LAST:"Current\:%8.2lf\n"  \
LINE1:cdefg#000000:"Total" 

User avatar
fmangeant
Cacti Guru User
Posts: 2326
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

#13 Post by fmangeant » Wed Sep 06, 2006 9:24 am

Can you go to systems utilities -> view poller cache, and check the entries for this graph ?

You should have something like this :
Data Source: phoenix - Load Average - 15 Minute
RRD: /cacti/RRD/Supervision/Phoenix/supervision_phoenix_load_15min_393.rrd
Action: 0, OID: .1.3.6.1.4.1.2021.10.1.3.3 (Host: 10.50.80.190, Community: public)
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]

kamina
Posts: 28
Joined: Tue Aug 22, 2006 3:19 am

#14 Post by kamina » Wed Sep 06, 2006 10:15 am

fmangeant wrote:Can you go to systems utilities -> view poller cache, and check the entries for this graph ?

You should have something like this :
Data Source: phoenix - Load Average - 15 Minute
RRD: /cacti/RRD/Supervision/Phoenix/supervision_phoenix_load_15min_393.rrd
Action: 0, OID: .1.3.6.1.4.1.2021.10.1.3.3 (Host: 10.50.80.190, Community: public)

Code: Select all

 Data Source: Jazz - Vmware Host - Load Average - 5 Minute
RRD: /var/www/cacti/rra/jazz_vmware_host_load_5min_91.rrd
Action: 0, OID: .1.3.6.1.4.1.2021.10.1.3.2 (Host: jazz.sulake.com, Community: public) 

User avatar
fmangeant
Cacti Guru User
Posts: 2326
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

#15 Post by fmangeant » Thu Sep 07, 2006 2:29 am

Can you run this :

Code: Select all

$ snmpwalk -v 1 -c public jazz.sulake.com .1.3.6.1.4.1.2021.10.1.3.2
and check that the result is the same than on the graph ?
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]

Post Reply