RE: How can I define my own trap?
Fernández Piñas, David <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
I once defined a custom trap for monitoring calls on a VSAT this way:
ncpcallcleared NOTIFICATION-TYPE
OBJECTS { systemtrafficload, eventcode }
STATUS current
DESCRIPTION
"Call cleared notification"
::= { ncpcallevents 2 }
where systemtrafficload and eventcode where defined in the same MIB file as:
systemtrafficload OBJECT-TYPE
SYNTAX Integer32 (0..100)
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"System load in %, i.e. currenttrafficchannels / max. capacity (system total traffic channels )."
::= { ncpstatus 2 }
eventcode OBJECT-TYPE
SYNTAX INTEGER (0..900)
MAX-ACCESS accessible-for-notify
STATUS current
DESCRIPTION
"Call end event code."
::= { ncpcalleventsobjects 1 }
The traps where generated by an extension to snmpd process.
-----Mensaje original-----
De: Ignasi Paredes Oliva [mailto:[email protected]]
Enviado el: lunes, 26 de enero de 2009 18:46
Para: [email protected]
Asunto: How can I define my own trap?
Hello,
I'm trying to define my own trap but I don't know how should I do it.
For now I have created the MIB file example of the web on my
/usr/share/snmp/mibs:
TEST-MIB DEFINITIONS ::= BEGIN
IMPORTS ucdExperimental FROM UCD-SNMP-MIB;
demotraps OBJECT IDENTIFIER ::= { ucdExperimental 990 }
demoTrap TRAP-TYPE
ENTERPRISE demotraps
VARIABLES { sysLocation }
DESCRIPTION "An example of an SMIv1 trap"
::= 17
END
Using the following comand I can see the trap logged on my /var/log/daemon.log:
snmptrap -v 1 -c public 127.0.0.1 UCD-TRAP-TEST-MIB::demotraps "" 6 17 "" SNMPv2-MIB::sysLocation.0 s "Just here"
Now, my problem is that I want to define my own trap and I don't now how to do it. First, I want to retrieve some information of my mysql database and after that I would like to create a trap containing all that information (several numbers and strings) and, of course, send it. How should I do that? Should I create a new MIB file? In that case how can I define the desired list of variables?
Thank you in advance.
Best Regards,
Ignasi
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users