[AGENT++] Unavailable variables

Fehde, Marcus Marcus.Fehde at draeger.com
Thu Jul 15 12:48:54 CEST 2004


Hi Mads,

you can do this that way, but "resourceUnavailable" is not valid in context of an GET-request.
The appropriate error is "generalError" which will cause that the whole PDU is cancelled.
As workaround you may return a "noSuchObject" exception for the affected variable bindings, but this is not semantically correct.
Nevertheless it is bettern than using a wrong error status code.

Regards,
Marcu

-----Original Message-----
From: agentpp-bounces at agentpp.org [mailto:agentpp-bounces at agentpp.org] On Behalf Of Frank Fock
Sent: Donnerstag, 15. Juli 2004 12:32
To: Mads Møller Grønfeldt
Cc: agentpp at agentpp.org
Subject: Re: [AGENT++] Unavailable variables


Hi Mads,

You can set the error status by using the Request instace directly:

void myMibLeaf::get_request(Request* req, int index) {
   if (...) {
      req->error(index, SNMP_ERROR_RESOURCE_UNAVAIL);
   }
...
}

To add a row in the snmpTargetAddr table you will first have to add a row in the snmpTargetAddrParamsTable to able to reference that entry in your row. Try creating the rows using createAndWait(5) row status. Then you can set the values step by step. Make sure that the TAddress and TDomain values matches.

That should do the trick.

Best regards,
Frank

Mads Møller Grønfeldt wrote:

>Hi,
> 
>If my agent get a request for a variable that isn't available at the 
>moment( ie. a subsystem is down ), how do I indicate this to the requesting application? I guess I could use SNMP_ERROR_RESOURCE_UNAVAIL, but how do I "return" this as the answer to a get_request?
> 
>Secondly I am still having trouble adding a row to the snmpTargetAddr 
>table, if I try to add a row using the Mib Explorer, I get Inconsistent value, wrong value, etc. Can someone please give me a walkthrough for dummies on how to add a row to this table, as I obviously doesn't get it?
> 
>Best regards
>Mads
> 
>_______________________________________________
>AGENTPP mailing list
>AGENTPP at agentpp.org http://agentpp.org/mailman/listinfo/agentpp
>
>  
>


_______________________________________________
AGENTPP mailing list
AGENTPP at agentpp.org
http://agentpp.org/mailman/listinfo/agentpp
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: InterScan_Disclaimer.txt
Url: http://lists.agentpp.org/pipermail/agentpp/attachments/20040715/7ace7dba/attachment.txt 


More information about the AGENTPP mailing list