On Tue, 11 Apr 2006 16:01:11 +0300 Ofer wrote:
OG> snmpCmd = "/usr/bin/snmptrap -v 2c -c public " + nmsIpAddress +
OG> " '' PROXY-MIB:roxyWrongUserPassTrap
OG> PROXY-MIB:roxyWrongUserPassTrap s " + snmpTrapDesc;
OG> Logger.logInformation(this, snmpCmd);
OG> Runtime.getRuntime().exec(snmpCmd);
OG> snmpTrapDesc, snmpCmd and nmsIpAddress are all String-s.
OG> I failed to get the sysUpTime in the trap on the trap receiver
OG> application. In C, the same works perfectly well (with the required
OG> modifications to code, of course). I get the trap, but w/o the
OG> sysUpTime.
OG> My questions:
OG> 1. Why aren't those double single quote signs working?
OG> 2. Is there something I can use to replace them (I tried
OG> SNMP_MIB2::sysUpTime.0. Didn't work).

It could be that the single quotes are getting eaten by the exec command. You
could try escaping them. Alternatively, you could try putting in an actual
uptime value.

NOTE: messages sent directly to me, instead of the lists, will be deleted
unless they are requests for paid consulting services.

Robert Story; NET-SNMP Junkie

You are lost in a twisty maze of little standards, all different.

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
Net-snmp-coders mailing list