Operating System - OpenVMS
1827834 Members
8948 Online
109969 Solutions
New Discussion

Re: How To Capture SNMP Messages

 
SOLVED
Go to solution
Robert Atkinson
Respected Contributor

How To Capture SNMP Messages


We have a printer that sends out SNMP messages regarding it's status (an OCE 3110).

Is it possible to capture and interrogate these messages from VMS?

Rob.
7 REPLIES 7
Wim Van den Wyngaert
Honored Contributor

Re: How To Capture SNMP Messages

Yes. With sys$system:tcpip$snmp_traprcv.

Or write a program yourself.

Or use cockpit of HP.

Remember : it sends it once. If the UDP packet is lost, you loose your alarm.

Wim
Wim
Robert Atkinson
Respected Contributor

Re: How To Capture SNMP Messages

I found various links to this on the web, but am still a little baffled about how it works.

Is there anyone willing to work with me offline, to get the process working?

Thanks, Rob.
Heinz W Genhart
Honored Contributor

Re: How To Capture SNMP Messages

Hi Robert

I wrote a procedure some time ago, which does the following:

- it receives traps sent do this machine's address
- If the trap contains a specific oid the procedure extracts the text from the trap and sends it by email to me.

If you think this procedure could help you to solve your problem, so just let me know and I can attach the stuff


Regards

Heinz
Robert Atkinson
Respected Contributor

Re: How To Capture SNMP Messages

Heinz - I this that would work very well.

Please can you email to ratkinson/at/tbs-ltd.co.uk

Cheers, Rob.
Heinz W Genhart
Honored Contributor
Solution

Re: How To Capture SNMP Messages

Hi Rob

The procedures are very small

You have to replace the device name and the directory name in all the commandfiles


START_TRAPRECEIVE.COM

$ run sys$system:loginout.exe -
/detach -
/input=GFR_TOOLS:[TRAPRECEIVE]trapreceive.com -
/output=GFR_TOOLS:[TRAPRECEIVE]trapreceive.log -
/error=GFR_TOOLS:[TRAPRECEIVE]trapreceive.log -
/process_name="TrapRCV"


TRAPRECEIVE.COM

$ SET NOON
$ PIPE mc TCPIP$SNMP_TRAPRCV.EXE | @GFR_TOOLS:[TRAPRECEIVE]tee
$ EXIT


TEE.COM

$ SET NOON
$ set verify
$ proc=F$ENVIRONMENT("PROCEDURE")
$ def_dir=F$PARSE(proc,,,"DEVICE") + F$PARSE(proc,,,"DIRECTORY")
$ set def 'def_dir'
$ DEFINE SYS$SCRATCH 'def_dir'
$loop:
$ READ/END_OF_FILE=clean_up SYS$PIPE line
$ IF F$LOCATE("1.3.6.1.4.1.1339 =",line) .EQ. F$LENGTH(line) THEN GOTO loop
$ text = F$EXTRACT(19,F$LENGTH(line)-19, line)
$ write sys$output text
$ mail/Subject="''text'" nl: smtp%"genhart@gfr.ch"
$ GOTO LOOP
$clean_up:
$ EXIT

If You have any questions, please let me know. The procedures are not very sophisticated, but they worked fine for me to solve my problem


Regards

Heinz
Heinz W Genhart
Honored Contributor

Re: How To Capture SNMP Messages

Hi Rob

Could you solve the problem ?


Regards

Heinz
Robert Atkinson
Respected Contributor

Re: How To Capture SNMP Messages

Yes, thanks Heinz.

In the end, I ended up with a routine like this :-

$GET_STATUS:
$ PIPE SNMP_REQUEST FTG'QUEUE' "oce_read" get 1.3.6.1.2.1.43.16.5.1.2.1.1 > SYS$TEMP:MONIOCE_'QUEUE'.TMP ! Get overall status
$ !
$ OPEN /READ INFILE SYS$TEMP:MONIOCE_'QUEUE'.TMP
$ READ INFILE INDATA
$ CLOSE INFILE
$ !
$ DELETE /NOLOG SYS$TEMP:MONIOCE_'QUEUE'.TMP;*
$ !
$ STATUS = F$EDIT(F$ELEM(1,"=",INDATA),"TRIM")
$ !
$ WS "%UMO-I-STATUS, ''QUEUE' showing '" + "''STATUS'" + "'"
$ !

Cheers, Rob.