× 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.



My problem is that I try to do an snmpSet with the same prototype I have
to snmpGet
but now I been out of luck.


I allways get a return code -10 that says
-10 API_RC_INVALID_VALUE

The specified value in the varbind is not valid.

The Code:

HDFTACTGRP( *NO ) BNDDIR( 'QC2LE' )



* Parameter for SETSNMP

Dprm PR extpgm('SETSNMPRPG')

D RCPRM 10A

D VAPRM 50A

Dprm PI

D RCPRM 10A

D VAPRM 50A



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(50)

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

D VALUE S 50A

D OID S 50A INZ(X'F14BF34B+

D F64BF14BF24BF14BF14BF64BF000')

D HOST S 14A INZ('as4he3t.fdb.dk')


D CMTY S 6A INZ('public')

D Translate PR ExtPgm('QDCXLATE')
D Length 5P 0 Const
D Data 9A
D Table 10A Const

/Free
// Translate VALUE EBCDIC to ASCII
%SUBST(VALUE: 1: 9) = VAPRM;
CALLP Translate(9: VALUE: 'QTCPASC');
DSPLY VALUE;
// Set SNMP MIB
OID = '1.3.6.1.2.1.1.4.0' + X'00';
HOST = 'as4he3t.xxx.dk'; // 14 Char long
CMTY = 'public'; // 6 Char long
RC = SETSNMP(%ADDR(SNMPPDU):%ADDR(HOST):14:%ADDR(CMTY):6);
If RC = 0;
RCPRM = '0';
Else;

RCPRM = %Char(RC);
EndIf;
*InLr = *on;
/End-Free


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.