Link to home
Start Free TrialLog in
Avatar of yogio
yogio

asked on

Cacti SNMP Trap

Hello,
I have Cacti setup to monitor devices in our company.  I want to know how to set up Cacti to receive snmp trap from those devices.  I read there is a plugin CAMM that works with Cacti, but I can't find much information to make that to work.  I appreciate any information.
Thanks
Avatar of arnold
arnold
Flag of United States of America image

Searching for "cacti snmptrap" you'll find an assortment including this referencing the authors disinterest in this functionality.

Are you looking to graph the number of times a trap is received?
Or do you need a context for the snmptrap?
Snmptrapd/syslogd syslog/messages or a specific logfile (snmptrapd can be configure to log events into a specific authority/facility such that syslog can the be configured to direct the specific authority/facility level into a specific file with) that is scanned for snmptrap events and reported.
Avatar of yogio
yogio

ASKER

I have install the CAMM plugin on Cacti.  I am trying to have all my devices to send traps to Cacti so that I can monitor any events.
I have use an APC device to send a test trap to Cacti, but Cacti doesn't receive the trap. I checked Cacti is listening to port 162.  
I have configured the snmptrapd.conf with the following communitystring.  It should be able to allow the trap to coming in.  But I don't see anything on the CAMM page.
  authCommunity   log,execute,net public

Not sure I am missing anything else.  The snmptt.conf has the default Event config as shown below:
EVENT coldStart .1.3.6.1.6.3.1.1.5.1 "Status Events" Normal
FORMAT Device reinitialized (coldStart)
#EXEC qpage -f TRAP notifygroup1 "Device reinitialized (coldStart)"
SDESC
A coldStart trap signifies that the SNMPv2 entity, acting
in an agent role, is reinitializing itself and that its
configuration may have been altered.
EDESC

Is there a log somewhere I can check the APC trap did arrive?  
Thanks
Usually snmptrapd are sent to public community.
Not  familiar with the plugin, but do not think cacti is the one listening but has a script that goes through the log where the traps are logged.
- does snmptt receive the traps ? if yes where does it log them ?
- did you configure CAMM to read that same log ?

by default snmptrapd will use syslog. it is possible that your syslog is configured to trash the notifications

http://www.net-snmp.org/wiki/index.php/TUT:Configuring_snmptrapd

this contains examples that will let you speciy log file names or stdout so you can go on
Avatar of yogio

ASKER

Yes, CAMM picked up traps, but they all gone into the Unknown Traps.  I haven't enable Syslog in CAMM.  I am not using Syslog at the moment, but I might try it out later.

How can I set the devices to report traps in the SNMP Traps instead logging in Unknown Traps?

Also all the devices are reported hostname as their IP address.  Is there a setting to have them report in their actual hostname?
Thanks
as far as i understand, cacti+camm are slaves to trapd in this respect : trapd is responsible for mapping oids to types

i don't know about your specific configuration but it seems your trapd is not configured so everything is sent into "unknown". it would be much easier to help if you posted details about your setup and the relevant config files

in the link i posted precviously, you'll find lines such as
traphandle SNMPv2-MIB::coldStart    /home/nba/bin/traps cold
traphandle SNMPv2-MIB::warmStart    /home/nba/bin/traps warm

Open in new window


i'd assume any oid that is not configured in this way is of type "unknown", so if you have not configured anything, all traps are unknown
Avatar of yogio

ASKER

Thanks for the help.  I don't what I did wrong.  After I added the traphandle lines, CAMM no longer receive any traps.  When using "traphandle default snmptt" I was able to receive traps in the Unknown Traps menu.

My snmptrapd.conf:
       authCommunity   log,execute,net public

      traphandle SNMPv2-MIB::coldStart    /usr/bin/traps cold
      traphandle SNMPv2-MIB::warmStart    /usr/bin/traps warm
      traphandle IF-MIB::linkDown    /usr/bin/traps ifdown
      traphandle IF-MIB::linkup    /usr/bin/traps ifup
      traphandle SNMPv2-MIB::authenticationFailure    /usr/bin/traps authfail
      #traphandle default snmptt

I have created handler scripts for each traphandle, except the default snmptt
 #!/bin/sh
 
 read host
 read ip
 vars=
 
 while read oid val
 do
   if [ "$vars" = "" ]
   then
     vars="$oid = $val"
   else
     vars="$vars, $oid = $val"
   fi
 done
 
 echo trap: $1 $host $ip $vars
ASKER CERTIFIED SOLUTION
Avatar of skullnobrains
skullnobrains

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial