- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- sending snmp traps in openVMS
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2009 07:47 PM
03-20-2009 07:47 PM
sending snmp traps in openVMS
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"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2009 05:19 AM
03-21-2009 05:19 AM
Re: sending snmp traps in openVMS
Find some source code for snmp_traps[e]nd,
and steal it?
(Read the RFC, and write your own?)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2009 07:27 AM
03-21-2009 07:27 AM
Re: sending snmp traps in openVMS
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2009 05:57 AM
03-23-2009 05:57 AM
Re: sending snmp traps in openVMS
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 ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2009 08:18 AM
03-23-2009 08:18 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2009 10:13 AM
03-23-2009 10:13 AM
Re: sending snmp traps in openVMS
this url is not working :(
can you please check ? also is NET:SNMP is a third party product ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2009 10:46 AM
03-23-2009 10:46 AM
Re: sending snmp traps in openVMS
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2009 01:56 PM
03-23-2009 01:56 PM
Re: sending snmp traps in openVMS
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,
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2009 02:01 PM
03-23-2009 02:01 PM
Re: sending snmp traps in openVMS
snmp_trapsnd + system() "from DEC C"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2009 02:08 PM
03-23-2009 02:08 PM
Re: sending snmp traps in openVMS
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2009 02:10 PM
03-23-2009 02:10 PM
Re: sending snmp traps in openVMS
if you can help me write this snmp_trap for DEC C i would be greatful. First of all where do I get the source code of snmp_trapsend?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2009 07:31 PM
03-23-2009 07:31 PM
Re: sending snmp traps in openVMS
_do_ know how to run a program using the
system() function.
show symbol snmp_trapsnd
alp $ type snmp.c
#include
#include
int main( void)
{
int sts;
char *cmd = "mcr tcpip$snmp_trapsnd.exe\
1.3.6.1.6.3.1.1.4.1.0 local 0 0 0 -v2c -h 10.100.10.112";
printf( " cmd: >%s<.\n", cmd);
sts = system( cmd);
printf( " sts = %%x%08x.\n", sts);
}
alp $ cc snmp
alp $ link snmp
alp $ run snmp
cmd: >mcr tcpip$snmp_trapsnd.exe 1.3.6.1.6.3.1.1.4.1.0 local 0 0 0 -v2c -h 10.1
00.10.112<.
sts = %x00000001.
Around here, no one seems to know what "-D"
does (with or without quotation marks):
ALP $ mcr tcpip$snmp_trapsnd.exe 1.3.6.1.6.3.1.1.4.1.0 local 0 0 0 -v2c -h 10.10
0.10.112 -D "TEST MESSAGE FROM node1 USING TCP SNMP TRAP"
Unexpected arguments.
#snmp_trapsnd enterprise agent-address generic specific timeticks
[-v version] [-c community] [-h host] [-p port] [-tcp] {variable [type value]}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2009 07:55 PM
03-23-2009 07:55 PM
Re: sending snmp traps in openVMS
as you see below without the "D" argument snmp command does not work . I found out somewhere someone using it thats how I learned. so assuming this is the right command I have to use how can I put it in the C program cause its using double quotes ?
This is a perfectly working command and
we are using it .
NODE1$ snmp_trapsnd 0.0 local 0 0 0 -h 10.100.18.245 -v2c 1.3.6.1.6.3.1.1.4.1.0
"D" " TEST MSG "
if I omit the "D" or dont use it the command
does not work.
NODE1$ snmp_trapsnd 0.0 local 0 0 0 -h 10.100.18.245 -v2c 1.3.6.1.6.3.1.1.4.1.0
" " " TEST MSG "
Unknown data type code
Invalid variable list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2009 08:30 PM
03-23-2009 08:30 PM
Re: sending snmp traps in openVMS
char *cmd = "mcr sys$system:tcpip$snmp_trapsnd.exe 0.0 local 0 0 0 -h 10.100.18.245 -v2c 1.3.6.1.6.3.1.1.4.1.0 "D" "test"";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2009 08:50 PM
03-23-2009 08:50 PM
Re: sending snmp traps in openVMS
char *cmd = "mcr sys$system:tcpip$snmp_trapsnd.exe 0.0 local 0 0 0 -h 10.100.18.245 -v2c 1.3.6.1.6.3.1.1.4.1.0 \"D\" \"<
now my second problem ... i need to pass the message part as parameter .. how can I do this ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2009 09:12 PM
03-23-2009 09:12 PM
Re: sending snmp traps in openVMS
sprintf()? strcat()?
How much don't you know about C programming?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2009 09:14 PM
03-23-2009 09:14 PM
Re: sending snmp traps in openVMS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2009 07:25 AM
03-24-2009 07:25 AM
Re: sending snmp traps in openVMS
If it's your manager that tossed you into this proverbial pool, then this is your opportunity to request training or books or more formal assistance (which helps your manager deliver on his/her commitments, and it also helps you) on these topics. I would strongly encourage you to work with your manager here, rather than with ITRC. ITRC really isn't going to help you through this, though. That's your manager's job.
There's no API for sending traps on OpenVMS, it's done through a C or Perl or Lua or other SNMP-related library that you must port over (or find somebody to port it for you) and there's no source code for the snmp_trapsnd tool (ask HP for that).
There's some basic SNMP source code stuff in
SYS$COMMON:[SYSHLP.EXAMPLES.TCPIP.SNMP]
but I'd not expect that code to get anywhere near what you're looking for here.
Your application programming interface is going to require the Perl or Lua or C or (pick your preferred OpenVMS language) SNMP library. A library which you're going to have to port, or get somebody to port for you.
I've had various tussles with TCP/IP Services and C in this area over the years. It's not a very forgiving area.
Did some quick digging using Google and there's no obvious solution here that doesn't also involve a library such as net-snmp. The snmptrap command in Mac OS X source pool is based on a C module that looks to call into the net-snmp library, for instance. And the Lua stuff all uses a LuaSNMP library. You could certainly use the RFC to build the full RFC-specified data and toss that over, but (for now) the system() of the command is almost certainly the easiest approach.
As for the "-d" switch on the command (I prefer to quote those switches, unless I know I'm running with the ODS-5 extended parsing enabled within DCL), that's a packet dump request, based on what's in the documentation:
http://h71000.www7.hp.com/doc/82final/6530/6530pro_005.html
I'd guess that you don't have extended parsing enabled here, and thus that the usual (and somewhat weird) C argument processing rules apply. DCL upcases its stuff, and the switch and the rest of the command is converted to lowercase when gets to C, so your -D is showing up at snmp_trapsnd as the -d switch.
And again, work with your manager. That'll help you get trained; it'll help your manager deliver on his/her commitments through your improved skills.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2009 09:09 AM
03-29-2009 09:09 AM