×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
Thanks for all the Answers. Mr. Morris I think you get me Closer
to the error I have. I have now change the setup so the
HOST_PTR and TIMEOUT parameters should bee correct.
And I was already investigate the ANSTYPE field that I also
have missed. My other problems is that I not have converted
the CMTY (communities) to ASCII. This gave me some headage because all
windows/Unix/AS400 systems seems to have this in ASCII and z/OS
system has this in EBCDIC.
But I still have some trouble with snmpSet. It now gives me Return code
-5 API_RC_OUT_OF_BUFFERS There were not enough internal buffers to
continue
But if I change the ASNTYPE to ASN_NULL then I got Return Code 0 OK. But
I do nothing. No data has been written to MIB.
ASN Type I have found is now included in my test program. And this
program do both a Write and a Read MIB.
I hope any one can help me more please. !!
HDFTACTGRP( *NO ) BNDDIR( 'QC2LE' )
D GETSNMP PR 10I 0 EXTPROC('snmpGet')
D PDU_PTR * VALUE
D HOST_PTR * VALUE OPTIONS(*STRING)
D TIMEOUT 10I 0 VALUE
D COMM_PTR * VALUE OPTIONS(*STRING)
D COMM_LEN 10I 0 VALUE
D SETSNMP PR 10I 0 EXTPROC('snmpSet')
D PDU_PTR * VALUE
D HOST_PTR * VALUE OPTIONS(*STRING)
D TIMEOUT 10I 0 VALUE
D COMM_PTR * VALUE OPTIONS(*STRING)
D COMM_LEN 10I 0 VALUE
D VARBIND DS
D NEXT * INZ(*NULL)
D POID * INZ(%ADDR(OID))
D ASNTYPE 1A
D VALLEN 10I 0 INZ(4)
D VALPTR * INZ(%ADDR(VALUE))
D SNMPPDU DS
D PDUTYPE 1A
D ERRSTS 10I 0
D ERRIDX 10I 0
D PVARBIND * INZ(%ADDR(VARBIND))
D RC 10I 0 INZ(0)
D VALUE S 4A
D OID S 50A INZ(X'F14BF34B+
D F64BF14BF24BF14BF14BF64BF000')
D F64BF14BF24BF14BF14BF64BF000')
D HOST S 50A
D CMTY S 6A
D Translate PR ExtPgm('QDCXLATE')
D Length 5P 0 Const
D Data 4A
D Table 10A Const
D ASN_INTEGER s 2A INZ(x'02')
D ASN_OCTET_STR s 2A INZ(x'04')
D ASN_NULL s 2A INZ(x'05')
D ASN_OBJECT_ID s 2A INZ(x'06')
D ASN_IpAddress s 2A INZ(x'40')
D ASN_Counter s 2A INZ(x'41')
D ASN_Gauge s 2A INZ(x'42')
D ASN_TimeTicks s 2A INZ(x'43')
D ASN_Opaque s 2A INZ(x'44')
D RCPRM S 10A INZ(' ')
/Free
OID = '1.3.6.1.2.1.1.4.0' + X'00';
HOST = 'AS4HE3T.FDB.DK';
CMTY = x'7075626C6963'; // VALUE = 'public' in ASCII
VALUE = x'54455354'; // VALUE = 'TEST' in ASCII
ASNTYPE = ASN_OCTET_STR;
RC = SETSNMP(%ADDR(SNMPPDU):%TRIM(HOST):2:%ADDR(CMTY):6);
If RC = 0;
RCPRM = '0';
Else;
RCPRM = %Char(RC);
EndIf;
DSPLY RCPRM;
RC = GETSNMP(%ADDR(SNMPPDU):%TRIM(HOST):2:%ADDR(CMTY):6);
If RC = 0;
RCPRM = '0';
Else;
RCPRM = %Char(RC);
EndIf;
// Translate VALUE ASCII to EBCDIC
CALLP Translate(4: VALUE: 'QTCPEBC');
DSPLY RCPRM;
DSPLY VALUE;
*InLr = *on;
/End-Free
Regards Poul
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.