use of org.netxms.base.NXCPMessage in project netxms by netxms.
the class NXCSession method modifyAction.
/**
* Modify server action
*
* @param action Action object
* @throws IOException if socket I/O error occurs
* @throws NXCException if NetXMS server returns an error or operation was timed out
*/
public void modifyAction(ServerAction action) throws IOException, NXCException {
final NXCPMessage msg = newMessage(NXCPCodes.CMD_MODIFY_ACTION);
action.fillMessage(msg);
sendMessage(msg);
waitForRCC(msg.getMessageId());
}
use of org.netxms.base.NXCPMessage in project netxms by netxms.
the class NXCSession method getThresholdSummary.
/**
* Get threshold violation summary for all nodes under given parent object. Parent object could
* be container, subnet, zone, entire network, or infrastructure service root.
*
* @param objectId parent object ID
* @return list of threshold violation summary objects for all nodes below given root
* @throws IOException if socket I/O error occurs
* @throws NXCException if NetXMS server returns an error or operation was timed out
*/
public List<ThresholdViolationSummary> getThresholdSummary(final long objectId) throws IOException, NXCException {
final NXCPMessage msg = newMessage(NXCPCodes.CMD_GET_THRESHOLD_SUMMARY);
msg.setFieldInt32(NXCPCodes.VID_OBJECT_ID, (int) objectId);
sendMessage(msg);
final NXCPMessage response = waitForRCC(msg.getMessageId());
List<ThresholdViolationSummary> list = new ArrayList<ThresholdViolationSummary>();
long varId = NXCPCodes.VID_THRESHOLD_BASE;
while (response.getFieldAsInt64(varId) != 0) {
final ThresholdViolationSummary t = new ThresholdViolationSummary(response, varId);
list.add(t);
varId += 50 * t.getDciList().size() + 2;
}
return list;
}
use of org.netxms.base.NXCPMessage in project netxms by netxms.
the class NXCSession method getSnmpTrapsConfigurationSummary.
/**
* Get summary of SNMP trap mapping. Trap configurations returned without parameter mapping.
*
* @return List of SnmpTrap objects
* @throws IOException if socket I/O error occurs
* @throws NXCException if NetXMS server returns an error or operation was timed out
*/
public List<SnmpTrap> getSnmpTrapsConfigurationSummary() throws IOException, NXCException {
final NXCPMessage msg = newMessage(NXCPCodes.CMD_GET_TRAP_CFG_RO);
sendMessage(msg);
final NXCPMessage response = waitForRCC(msg.getMessageId());
int count = response.getFieldAsInt32(NXCPCodes.VID_NUM_TRAPS);
List<SnmpTrap> list = new ArrayList<SnmpTrap>(count);
long varId = NXCPCodes.VID_TRAP_INFO_BASE;
for (int i = 0; i < count; i++) {
list.add(new SnmpTrap(response, varId));
varId += 10;
}
return list;
}
use of org.netxms.base.NXCPMessage in project netxms by netxms.
the class NXCSession method updateSchedule.
public void updateSchedule(ScheduledTask task) throws IOException, NXCException {
final NXCPMessage msg = newMessage(NXCPCodes.CMD_UPDATE_SCHEDULE);
task.fillMessage(msg);
sendMessage(msg);
waitForRCC(msg.getMessageId());
}
use of org.netxms.base.NXCPMessage in project netxms by netxms.
the class NXCSession method getNodeWinPerfObjects.
/**
* Get list of available Windows performance objects. Returns empty list if node
* does is not a Windows node or does not have WinPerf subagent installed.
*
* @param nodeId node object ID
* @return list of available Windows performance objects
* @throws IOException if socket I/O error occurs
* @throws NXCException if NetXMS server returns an error or operation was timed out
*/
public List<WinPerfObject> getNodeWinPerfObjects(long nodeId) throws IOException, NXCException {
final NXCPMessage msg = newMessage(NXCPCodes.CMD_GET_WINPERF_OBJECTS);
msg.setFieldInt32(NXCPCodes.VID_OBJECT_ID, (int) nodeId);
sendMessage(msg);
final NXCPMessage response = waitForRCC(msg.getMessageId());
return WinPerfObject.createListFromMessage(response);
}
Aggregations