how to activate snmptrapd deamon in solaris machine


 
Thread Tools Search this Thread
Operating Systems Solaris how to activate snmptrapd deamon in solaris machine
# 1  
Old 02-28-2008
how to activate snmptrapd deamon in solaris machine

hi i am able to see the snmpd service running in my machine. i would like to get activate snmptrapd deamon services in my solaris box, could any one suggest me in getting activate the snmptrapd service
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

What is the Solaris OS deamon which controls Library?

Hi All, What is the Solaris OS deamon which controls the Libraries? Regards, Rakesh. (2 Replies)
Discussion started by: rakesh.413
2 Replies

2. Solaris

Solaris ssh client hangs when connecting to another Solaris machine

Got a strange problem. I have 4 Solaris servers all configured the same, Solaris 10 x86 update 10. When I try to ssh from one Solaris 10 server to another server ssh hangs. I have an identical server and when I try this everything works fine. The weird thing is if I am root on the server... (1 Reply)
Discussion started by: ccj4467
1 Replies

3. Solaris

How to activate "high" priority queues for codine (Sun Grid Engine) under solaris 10

How to activate "high" priority queues for codine (Sun Grid Engine) under solaris 10? What are the steps? (0 Replies)
Discussion started by: ionrivera
0 Replies

4. UNIX for Advanced & Expert Users

snmptrapd

Hi everybody, I'm trying to run a SNMP supervisor on Debian Lenny to supervise Uninteruptible Power Systems which support SNMP. I've installed snmp and snmpd debian packages for NET-SNMP 5.4.1 et i've configured /etc/snmp file with the snmpconf perl script : file /etc/snmp/snmp.conf #... (0 Replies)
Discussion started by: dedibox
0 Replies

5. Solaris

Unable to login using ssh,telnet onto my solaris machine with solaris 10 installed

Hi, I am unable to login into my terminal hosting Solaris 10 and get the below error message "Server refused to allocate pty ld.so.1: sh: fatal: libc.so.1: open failed: No such file or directory " Is there anyways i can get into my machine and what kind of changes are required to be... (7 Replies)
Discussion started by: sankasu
7 Replies

6. IP Networking

RSH to Ubuntu machine from Solaris machine?

This is probably really basic compared to what you guys are usually talking about here, but I have a problem and I have no idea what to do about it. I try to RSH to my Ubuntu computer from my Solaris one and run into a dead end: >> rsh 192.168.1.103 ::ffff:192.168.1.103: Connection timed out... (4 Replies)
Discussion started by: Bradj47
4 Replies

7. Solaris

Solaris user account de-activated, command to activate again

My admin has set password policy to de-activate user account if there is not login for 90 days. How can i re-activate user account w/o deleting, or changing user password. Thanks in advance Deeps (6 Replies)
Discussion started by: admin@solaris
6 Replies

8. Solaris

Best possible communication mechanism between a Solaris machine and a windows machine

hi, I have some windows client machines which require a signal to be sent by a Solaris machine( SunOS 5.6) when ever a particular event occurs on that Solaris machine. What are possible communication mechanisms by which i can do this. the constraints are > the windows machines have to... (7 Replies)
Discussion started by: Krsh
7 Replies

9. UNIX for Dummies Questions & Answers

snmptrapd.conf

i tried this to get snmptrapd.conf bt unable... # snmpconf The following installed configuration files were found: 1: /etc/snmp/snmp.conf 2: /etc/snmp/snmpd.conf 3: /usr/share/snmp/snmp.conf 4: /usr/share/snmp/snmpd.conf Would you like me to read them in? Their... (0 Replies)
Discussion started by: jeenat
0 Replies

10. UNIX for Dummies Questions & Answers

Print deamon? Solaris 4.1.4

hi, guys, I've met a problem when print some file on the printer. it says: "no deamon present" the system is solaris 4.1.4 i can't find reference on the docs.sun.com so, what can I do about this? Thanks a lot. (1 Reply)
Discussion started by: cloudsmell
1 Replies
Login or Register to Ask a Question
TrapReceiver(3pm)					User Contributed Perl Documentation					 TrapReceiver(3pm)

NAME
NetSNMP::TrapReceiver - Embedded perl trap handling for Net-SNMP's snmptrapd SYNOPSIS
Put the following lines in your snmptrapd.conf file: perl NetSNMP::TrapReceiver::register("trapOID", &myfunc); ABSTRACT
The NetSNMP::TrapReceiver module is used to register perl subroutines into the Net-SNMP snmptrapd process. Net-SNMP MUST have been configured using --enable-embedded-perl. Registration of functions is then done through the snmptrapd.conf configuration file. This module can NOT be used in a normal perl script to receive traps. It is intended solely for embedded use within the snmptrapd demon. DESCRIPTION
Within the snmptrapd.conf file, the keyword "perl" may be used to call any perl expression and using this ability, you can use the NetSNMP::TrapReceiver module to register functions which will be called every time a given notification (a trap or an inform) is received. Registered functions are called with 2 arguments. The first is a reference to a hash containing information about how the trap was received (what version of the SNMP protocol was used, where it came from, what SNMP user name or community name it was sent under, etc). The second argument is a reference to an array containing the variable bindings (OID and value information) that define the noification itself. Each variable is itself a reference to an array containing three values: a NetSNMP::OID object, the value that came associated with it, and the value's numeric type (see NetSNMP::ASN for further details on SNMP typing information). Registered functions should return one of the following values: NETSNMPTRAPD_HANDLER_OK Handling the trap succeeded, but lets the snmptrapd demon check for further appropriate handlers. NETSNMPTRAPD_HANDLER_FAIL Handling the trap failed, but lets the snmptrapd demon check for further appropriate handlers. NETSNMPTRAPD_HANDLER_BREAK Stops evaluating the list of handlers for this specific trap, but lets the snmptrapd demon apply global handlers. NETSNMPTRAPD_HANDLER_FINISH Stops searching for further appropriate handlers. If a handler function does not return anything appropriate or even nothing at all, a return value of NETSNMPTRAPD_HANDLER_OK is assumed. Subroutines are registered using the NetSNMP::TrapReceiver::register function, which takes two arguments. The first is a string describing the notification you want to register for (such as "linkUp" or "MyMIB::MyTrap" or ".1.3.6.1.4.1.2021...."). Two special keywords can be used in place of an OID: "default" and "all". The "default" keyword indicates you want your handler to be called in the case where no other handlers are called. The "all" keyword indicates that the handler should ALWAYS be called for every notification. EXAMPLE
As an example, put the following code into a file (say "/usr/local/share/snmp/mytrapd.pl"): #!/usr/bin/perl sub my_receiver { print "********** PERL RECEIVED A NOTIFICATION: "; # print the PDU info (a hash reference) print "PDU INFO: "; foreach my $k(keys(%{$_[0]})) { if ($k eq "securityEngineID" || $k eq "contextEngineID") { printf " %-30s 0x%s ", $k, unpack('h*', $_[0]{$k}); } else { printf " %-30s %s ", $k, $_[0]{$k}; } } # print the variable bindings: print "VARBINDS: "; foreach my $x (@{$_[1]}) { printf " %-30s type=%-2d value=%s ", $x->[0], $x->[2], $x->[1]; } } NetSNMP::TrapReceiver::register("all", &my_receiver) || warn "failed to register our perl trap handler "; print STDERR "Loaded the example perl snmptrapd handler "; Then, put the following line in your snmprapd.conf file: perl do "/usr/local/share/snmp/mytrapd.pl"; Start snmptrapd (as root, and the following other opions make it stay in the foreground and log to stderr): snmptrapd -f -Le You should see it start up and display the final message from the end of the above perl script: Loaded the perl snmptrapd handler 2004-02-11 10:08:45 NET-SNMP version 5.2 Started. Then, if you send yourself a fake trap using the following example command: snmptrap -v 2c -c mycommunity localhost 0 linkUp ifIndex.1 i 1 ifAdminStatus.1 i up ifOperStatus.1 i up ifDescr s eth0 You should see the following output appear from snmptrapd as your perl code gets executed: ********** PERL RECEIVED A NOTIFICATION: PDU INFO: notificationtype TRAP receivedfrom 127.0.0.1 version 1 errorstatus 0 messageid 0 community mycommunity transactionid 2 errorindex 0 requestid 765160220 VARBINDS: sysUpTimeInstance type=67 value=0:0:00:00.00 snmpTrapOID.0 type=6 value=linkUp ifIndex.1 type=2 value=1 ifAdminStatus.1 type=2 value=1 ifOperStatus.1 type=2 value=1 ifDescr type=4 value="eth0" EXPORT
None by default. # =head2 Exportable constants # NETSNMPTRAPD_AUTH_HANDLER # NETSNMPTRAPD_HANDLER_BREAK # NETSNMPTRAPD_HANDLER_FAIL # NETSNMPTRAPD_HANDLER_FINISH # NETSNMPTRAPD_HANDLER_OK # NETSNMPTRAPD_POST_HANDLER # NETSNMPTRAPD_PRE_HANDLER SEE ALSO
NetSNMP::OID, NetSNMP::ASN snmptrapd.conf(5) for configuring the Net-SNMP trap receiver. snmpd.conf(5) for configuring the Net-SNMP snmp agent for sending traps. http://www.Net-SNMP.org/ AUTHOR
W. Hardaker, <hardaker@users.sourceforge.net> COPYRIGHT AND LICENSE
Copyright 2004 by W. Hardaker This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2009-10-29 TrapReceiver(3pm)