[SNMP4J] sql server traps

2008-05-08 Thread snmp girl
hello everyone,

I should send traps when something wrong happend with my sql server 2000, or
even someone change the dbs names so do you have any ideas about this?
I already add the sql mib and I can get all the sql server informations with
using the snmp requests, also I test the send and the receive of traps.

thanks a lot
___
SNMP4J mailing list
SNMP4J@agentpp.org
http://lists.agentpp.org/mailman/listinfo/snmp4j


[SNMP4J] receiving a trap

2008-04-15 Thread snmp girl
Hi,
I wrote a program in order to receive traps , here u find the code:
#

import org.snmp4j.*;
import org.snmp4j.event.*;
import org.snmp4j.smi.*;
import org.snmp4j.transport.*;
import java.io.*;

import org.snmp4j.util.*;

public class Receivetrap {
public static void main(String[] args)throws IOException {
{
Address targetAddress = GenericAddress.parse(udp:127.0.0.1/162);
TransportMapping transport = new
DefaultUdpTransportMapping((UdpAddress) targetAddress);
Snmp snmp = new Snmp(transport);

   snmp.listen();

CommandResponder trapPrinter = new CommandResponder()
{
public synchronized void processPdu(CommandResponderEvent e)
{
PDU command = e.getPDU();
if (command != null)
{

System.out.println(command.toString());
}
}
   };
   snmp.addCommandResponder(trapPrinter);


}
}
}
#

my problem is how can I print the contain of the trap

thanks a lot
___
SNMP4J mailing list
SNMP4J@agentpp.org
http://lists.agentpp.org/mailman/listinfo/snmp4j


[SNMP4J] snmpwalk

2008-04-10 Thread snmp girl
Hi
I wrote my first program using the snmp4j and it works , it is a basic
program that used the snmpset aand snmpget (udp.get/udp.set)
now I want to use the snmpwalk , and I don't if there is a function to use
or I have to write a whole programm, because to access to the oid of the sql
server mib I should use the snmpwalk that I had already test it in the mode
console and it works.

this is my program:


import org.snmp4j.*;
import org.snmp4j.event.*;
import org.snmp4j.smi.*;
import org.snmp4j.transport.*;
import java.io.*;
import org.snmp4j.CommunityTarget;

public class Test
{
public static void main(String[] args)throws IOException {
// TODO code application logic here
CommunityTarget target = new CommunityTarget();
Address targetaddress = new UdpAddress(127.0.0.1/161);
target.setAddress(targetaddress);
target.setCommunity(new OctetString(public));
target.setTimeout (1000);
target.setVersion(0);
target.setRetries(1);

   PDU pdu = new PDU();
   pdu.setType(PDU.GET);
   pdu.add(new VariableBinding(new OID(1.3.6.1.2.1.1.1.0)));
   TransportMapping transport = new DefaultUdpTransportMapping();
   transport.listen();
   try
   {
   Snmp snmp = new Snmp(transport);
   ResponseEvent respEv = snmp.send(pdu, target);
   PDU response = respEv.getResponse();
   System.out.println(response);
   }
   catch (Exception e)
   {
   System.out.println(Errror in snmp);
   }
  }
}
thanks
___
SNMP4J mailing list
SNMP4J@agentpp.org
http://lists.agentpp.org/mailman/listinfo/snmp4j


[SNMP4J] need an example

2008-04-09 Thread snmp girl
hello,

I need seeing an example of a program wich use the snmp4j api , so can
someone send it to me in order to start using it , because I search , i
didn't find examples to more understand how it's worh this api


thanks
___
SNMP4J mailing list
SNMP4J@agentpp.org
http://lists.agentpp.org/mailman/listinfo/snmp4j