Operating System - OpenVMS
1752708 Members
5697 Online
108789 Solutions
New Discussion юеВ

Re: sending snmp traps in openVMS

 
SAMI AHMAD
Regular Advisor

sending snmp traps in openVMS

hi !
I can send snmp traps from a dcl command job as follows , my question is can anyone guide me to do the same from DEC C ?


"
snmp_trapsnd 1.3.6.1.6.3.1.1.4.1.0 local 0 0 0 "-v2c" -h 10.100.10.112 -D "TEST MESSAGE FROM node1 USING TCP SNMP TRAP"
18 REPLIES 18
Steven Schweda
Honored Contributor

Re: sending snmp traps in openVMS

You mean other than system() or LIB$SPAWN()?

Find some source code for snmp_traps[e]nd,
and steal it?

(Read the RFC, and write your own?)
Hoff
Honored Contributor

Re: sending snmp traps in openVMS

If what is included in the manual "HP TCP/IP Services for OpenVMS SNMP Programming and Reference" and in the SNMP-related RFCs is insufficient for your requirements, then look to Google and look to the ITRC discussion where somebody last asked this:

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1247180

including at

http://sourceforge.net/projects/net-snmp/

Also:

http://64.223.189.234/node/1117
SAMI AHMAD
Regular Advisor

Re: sending snmp traps in openVMS

hi Hoff !

in your earlier reponse to this topic you had mentioned 'or you could haul over netsnmp or one of the perl modules' ... how can I use perl module to send the snmp trap ?
Martin Vorlaender
Honored Contributor

Re: sending snmp traps in openVMS

>>>
'or you could haul over netsnmp or one of the perl modules' ... how can I use perl module to send the snmp trap ?
<<<

There's Net::SNMP ,see e.g.

http://search.cpan.org/~dtown/Net-SNMP-5.2.0/lib/Net/SNMP.pm#trap()_-_send_a_SNMP_trap_to_the_remote_manager

HTH,
Martin

Disclaimer: I haven't tried it, but the requirements make it look doable.
SAMI AHMAD
Regular Advisor

Re: sending snmp traps in openVMS

hi Martin !
this url is not working :(
can you please check ? also is NET:SNMP is a third party product ?
Martin Vorlaender
Honored Contributor

Re: sending snmp traps in openVMS

Ahmad,

the URL worked when I clicked it. If it doesn't work for you, go to http://search.cpan.org/ and enter Net::SNMP (that's TWO colons) in the search box.

Net::SNMP is a Perl module that needs a few other prerequisite modules to be installed, but it does not (AFAICT) rely on other libraries like net-snmp.

cu,
Martin
SAMI AHMAD
Regular Advisor

Re: sending snmp traps in openVMS

Thanks Martin!

ok the url is working now for me ,below is the function to send trap but I dont see anywhere how to specify the msg you want to send as trap ? this is the dcl command I use to send trap msg :

snmp_trapsnd 1.3.6.1.6.3.1.1.4.1.0 local 0 0 0 "-v2c" -h 10.100.10.112 -D "TEST MESSAGE"

how can I send the above test msg to the server using the function below ?

$result = $session->trap(
[-delay => $seconds,] # non-blocking
[-enterprise => $oid,]
[-agentaddr => $ipaddress,]
[-generictrap => $generic,]
[-specifictrap => $specific,]
[-timestamp => $timeticks,]
-varbindlist => \@oid_value,
);
Steven Schweda
Honored Contributor

Re: sending snmp traps in openVMS

How is a perl method better than, say,
snmp_trapsnd + system() "from DEC C"?
SAMI AHMAD
Regular Advisor

Re: sending snmp traps in openVMS

hi Steven !

I dont know of a way to send snmp trap from dECC .. thats why i started this thread. are you saying its possible ? tell me how