[SNMP4J] detect timeout ?

FLORENT Philippe Philippe.FLORENT at edenred.com
Thu Oct 27 08:55:43 CEST 2016


What if I get an empty table ?

How to differentiate a timeout with a table that should actually be empty

-----Original Message-----
From: SNMP4J [mailto:snmp4j-bounces at agentpp.org] On Behalf Of Frank Fock
Sent: jeudi 27 octobre 2016 00:51
To: snmp4j at agentpp.org
Subject: Re: [SNMP4J] detect timeout ?

Hi Philippe,

The (last) TableEvent object will indicate the timeout in its status field.

Best regards,
Frank

Am 26.10.2016 um 15:05 schrieb FLORENT Philippe:
> Hi,
>
> I use this function to read infos on my host,
>
> But if the host (or the snmp service) is down, how do I detect it ?
>
> So far I check the table size must be >0 but what if table is 0 size and the host is not down ?
>
> thanks
>
> public ArrayList<TableRow> getTable(Mib mib)
>      {
>          final PDUFactory pduFactory = new DefaultPDUFactory(PDU.GETBULK);
>          pduFactory.createPDU(target);
>          final TableUtils utils = new TableUtils(snmp, pduFactory);
>          List<TableEvent> table = utils.getTable(target, new OID[]{ new OID(mib.oid) }, null, null);
>          for(TableEvent a:table)
>          {
>              if(a.getColumns()!=null)
>              {
> ....
>              }
>          }
>     }
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> https://oosnmp.net/mailman/listinfo/snmp4j

-- 
---
AGENT++
Maximilian-Kolbe-Str. 10
73257 Koengen, Germany
https://agentpp.com
Phone: +49 7024 8688230
Fax:   +49 7024 8688231

_______________________________________________
SNMP4J mailing list
SNMP4J at agentpp.org
https://oosnmp.net/mailman/listinfo/snmp4j


More information about the SNMP4J mailing list