[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: Developers, Moderators

davenpro
Posts: 6
Joined: Tue Dec 07, 2004 4:54 pm

Post by davenpro »

How does one enable 64-bit polling support in net-snmp on a FreeBSD machine?
kamina
Posts: 28
Joined: Tue Aug 22, 2006 3:19 am

Post by kamina »

Now here is something intresting. Jazz is still showing the cacti hosts loads, but I decided to do something differant. I created a template for Linux servers which includes free disk, cpu usage, load and memory usage. In other words everything I'm monitoring in Jazz (the template is kind of a clone of what I have monitored for jazz).

I added a new server, and everything is reported correctly (including load).

Thanks alot for your help. I believe everything you have said has been correct, and this seems to be related to the position of the planets or something similar. :lol:
kamina
Posts: 28
Joined: Tue Aug 22, 2006 3:19 am

Post by kamina »

I think I have finally figured what's wrong. I don't think it was showing the cacti hosts load at any point, rather the logic behind the graph is a bit skewed, and the resulting images happened to match the load in the cacti host.

Image

How much load does this machine have? The graph seems to imply there is (or has recently been) a load of around 4. In reality load is all the time around 1 (+ - 0.5).

I might be mistaken, but isn't this summing up 1, 5 and 15 minute load averigies? I don't know what the correct way to do this would be, but this kind of skews the results.
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

kamina wrote:I might be mistaken, but isn't this summing up 1, 5 and 15 minute load averigies? I don't know what the correct way to do this would be, but this kind of skews the results.
You're correct : this graph uses STACKS, so values for 1, 5 and 15 minute load averages seem to be added.

I agree, IMHO it's not the perfect way of displaying data...
[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

Post by kamina »

Tthanks, is there something simple I can change to make them merge into each other? In other words only show the highest peaks (don't know how to explain).
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Modify the graph template (use AREA instead of STACK for last 2).
[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]
roli8200
Posts: 2
Joined: Sun Aug 20, 2006 7:04 am

No success yet

Post by roli8200 »

carpenike wrote:Try adding this to your snmpd.conf:

agentaddress
Sorry, but it doesn't helpd at all. Already no snmp access from remote.
gerdesj
Posts: 1
Joined: Thu Nov 09, 2006 5:07 am

Re: HowTo: install and configure the Net-SNMP agent

Post by gerdesj »

You may find this handy. Documentation is rather limited for it and I didn't find much out from Google.

Suppose you want to get a counter from an arbitrary log file based on an arbitrary string. For example you want to get Spam Assassin stats out of spamd.log here's a simple way without additional scripts:

Put this into snmpd.conf:

-----------------------------
# Spamassassin (spamd)
logmatch saSpam /var/log/spamd/spamd.log 120 identified spam
logmatch saNotspam /var/log/spamd/spamd.log 120 clean message
-----------------------------
The syntax is:
logmatch <name> <logfile> <refresh in seconds> <regex>

Here's some more examples:

# Exim
logmatch eximIn /var/log/mail/mail.log 120 <=
logmatch eximOut /var/log/mail/mail.log 120 [-=]>

# SA-Exim
logmatch saeRej /var/log/mail/mail.log 120 SA: Action: permanently rejected message
logmatch saeTRej /var/log/mail/mail.log 120 SA: Action: temporarily rejected message
logmatch saeTag /var/log/mail/mail.log 120 SA: Action: flagged as Spam but accepted
logmatch saeDrop /var/log/mail/mail.log 120 SA: Action: silently tossed message
logmatch saeNoRun /var/log/mail/mail.log 120 SA: Action: Not running SA because SAEximRunCond
logmatch saeTeer1 /var/log/mail/mail.log 120 SA: Action: teergrubed sender for
logmatch saeTeer2 /var/log/mail/mail.log 120 SA: Action: teergrubed sender until full configured duration of
logmatch saeTimeOut /var/log/mail/mail.log 120 SA: Action: spamd took more than
logmatch saeFail /var/log/mail/mail.log 120 SA: Action: SA didn't successfully run against message
logmatch saeSize /var/log/mail/mail.log 120 SA: Action: check skipped due to message size
logmatch saeClean /var/log/mail/mail.log 120 SA: Action: scanned but message isn't spam
---------------------------------------

This will show you the tree:

snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.16

I tend to use .1.3.6.1.4.1.2021.16.2.1.5.1 etc which seem to be the "global" count but there are quite a few others which give say integers instead of counter32 or the count just for the last run and so on.
wertyuiop
Posts: 1
Joined: Mon Nov 27, 2006 8:14 am

Post by wertyuiop »

Can snmpwalk be used to get the traffic from different vlans on a on interface.Thanks in advance.
lzap
Posts: 1
Joined: Tue Jan 02, 2007 6:41 am

Post by lzap »

GREAT howto, thanks.

I am extending Net-SNMP and I need to provide some authentization for the clients. One client should be able to see only some values, the other something different. How to do this?

The Net-SNMP extending facility (scripts) are a bit simple...
Mika2006
Cacti User
Posts: 178
Joined: Thu May 03, 2007 2:25 am

Post by Mika2006 »

HP-UX probleme
please how i can use it?
i have untar the file
net-snmp-5.4-1-HP-UX_B.11.11_9000_800.tar.gz
on my root file /
and how i create a path for /usr/local/bin
now i can make snmpwalk
but i can change my
/etc/snmpd.conf
what i need to make now??
to lunch net-snmpd?
|Cacti Version - 0.8.6j||Plugin Architecture - 1.1||Poller Type - CMD.php|
|os - Red hat 4es | |Web Server - Apache/2.0.52 (Red Hat)|
|PHP - 4.3.9| |MySQL - 4.1.20| |RRDTool - 1.2.13||SNMP - 5.1.2|
|Plugins| Host Info (hostinfo - v0.1)
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Hi

AFAIK snmpd.conf on HP-UX is located in /usr/local/share/snmp

Once configured, launch the agent :

Code: Select all

# /usr/local/sbin/snmpd
[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]
Mika2006
Cacti User
Posts: 178
Joined: Thu May 03, 2007 2:25 am

Post by Mika2006 »

i try but nothing

i add this on my /etc/snmpd.conf
proc httpd
and i restart snmpd
# /usr/local/sbin/snmpd
but no change when i lunch the prTable i have nothing
no date


when i find snmp on my Hp-ux i found this maybe help?
root@root:/sbin/init.d # ll Snmp*
-r-xr-xr-x 1 bin bin 2589 Aug 15 2003 SnmpFddi4
-r-xr-xr-x 1 bin bin 6617 Dec 16 2002 SnmpHpunix
-r-xr-xr-x 1 bin bin 4558 Dec 16 2002 SnmpMaster
-r-xr-xr-x 1 bin bin 6727 Dec 16 2002 SnmpMib2
-r-xr-xr-x 1 bin bin 6631 Dec 16 2002 SnmpTrpDst
?
|Cacti Version - 0.8.6j||Plugin Architecture - 1.1||Poller Type - CMD.php|
|os - Red hat 4es | |Web Server - Apache/2.0.52 (Red Hat)|
|PHP - 4.3.9| |MySQL - 4.1.20| |RRDTool - 1.2.13||SNMP - 5.1.2|
|Plugins| Host Info (hostinfo - v0.1)
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

When installing Net-SNMP on HP-UX, you have to :
  • stop the native HP-UX SNMP agent
  • configure /usr/local/share/snmp/snmpd.conf
  • run /usr/local/sbin/snmpd
[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]
Mika2006
Cacti User
Posts: 178
Joined: Thu May 03, 2007 2:25 am

Post by Mika2006 »

i think i have probeleme with the install
i download this files :
net-snmp-5.4-1-HP-UX_B.11.11_9000_800.tar.gz
and i extract it on my root file system
in /

and nothing more
i think my install are not good?
|Cacti Version - 0.8.6j||Plugin Architecture - 1.1||Poller Type - CMD.php|
|os - Red hat 4es | |Web Server - Apache/2.0.52 (Red Hat)|
|PHP - 4.3.9| |MySQL - 4.1.20| |RRDTool - 1.2.13||SNMP - 5.1.2|
|Plugins| Host Info (hostinfo - v0.1)
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests