CodyLane

Java sending an alarm

Discussion created by CodyLane on Jul 26, 2011
Latest reply on Aug 9, 2011 by geir.haugom

Hello,

 

We have been experimenting with the Java SDK and have been trying to figure out how to send an alarm.  From the code below, we believe we are sending the alarm correctly but it never shows up in the alarm console in Infastructure Manager.  Any help would be greatly appreciated.

 

NimUserLogin.login("USERNAME", "PASSWORD", "HOSTNAME");

NimAlarm alarm = new NimAlarm(NimAlarm.NIML_WARNING, "Alarm generated from Java");

String id= alarm.send();
// Change the alarm to critical and send again
alarm.setSeverity(NimAlarm.NIML_CRITICAL);
alarm.send();
// Clear previous critical alarm
//alarm.setSeverity(NimAlarm.NIML_CLEAR);
//alarm.send();
System.out.println(alarm);
System.out.println(id);
System.out.println(alarm.isConnected());

 

//OUTPUT:

D, severity=5, message==Alarm generated from Java, subsystem=null, suppressionid=null, source=null
VQ20230184-03141
true

Outcomes