Skip to content

Commit

Permalink
BugFix
Browse files Browse the repository at this point in the history
  • Loading branch information
JRAndreassen committed Sep 29, 2015
1 parent b51da0b commit 3e2ab51
Show file tree
Hide file tree
Showing 8 changed files with 259 additions and 55 deletions.
92 changes: 46 additions & 46 deletions JMXMBeans.xml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions RemoteTomcat.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11557,6 +11557,7 @@ The following are all the JMX MBeans found
<unit/>
<enabled>true</enabled>
</attribute>
</attributes>
</entry>
</entries>
</profile>
Expand Down
202 changes: 202 additions & 0 deletions profiles/CiscoProfile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- ###########################################################
Unit Values[BANDWIDTH, MEMORY, DISK, FILE, TIME_RESPONSE, TIME_SECONDS, TIME_HOURS, TEMP, PERCENT, COUNT,CPU,CUSTOM]
***************************************************************
This file contains the definition of the PRTG JMXMiniProbe MBean
*** PLEASE DO NOT MODIFY ***
Please note, the apache.commons.digester3 is * VERY * case sensitive
########################################################### -->
<profiles xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Profile.xsd">
<profile>
<name>Profile: Cisco CPU Busy[Old]</name>
<kind>mjsnmpciscocpu1203sensor</kind>
<tag>mjmxsensor,mjsnmpesensor</tag>
<description>Cisco CPU IOS [12.0.3]</description>
<baseclass>com.paessler.prtg.jmx.sensors.SNMPSensor</baseclass>
<help>Monitors CISCO CPU Busy OIDs[pre ios 12.0.3] </help>
<entries>
<entry>
<object>Custom SNMP Object</object>
<displayvalue>Custom SNMP Display</displayvalue>
<description>SNMP: Custom</description>
<shortdescription>SNMP:Junk</shortdescription>
<help>Custom SNMP Obj, Help</help>
<attributes>
<attribute>
<object>1.3.6.1.4.1.9.2.1.58.0</object>
<displayvalue>CPU TotMonInt Busy</displayvalue>
<description>CPU TotMonInt Busy indicator</description>
<shortdescription/>
<comment>type=java.lang.int</comment>
<!--unit>{BANDWIDTH|MEMORY|DISK|FILE|TIME_RESPONSE|TIME_SECONDS|TIME_HOURS|TEMP|PERCENT|COUNT|CPU|CUSTOM}</unit-->
<unit>CPU</unit>
<!--customunit>Custom Unit name like "Unicorns"</customunit>
<enabled>true</enabled>
<mpy>1.0</mpy>
<div>1.0</div-->
<limitmode>1</limitmode>
<limitmaxerror>95</limitmaxerror>
<limitmaxwarning>75</limitmaxwarning>
<limiterrormsg>CPU 1min at unacceptable level</limiterrormsg>
<limitwarningmsg>CPU 1min approaching unacceptable level</limitwarningmsg>
</attribute>
<attribute>
<object>1.3.6.1.4.1.9.2.1.56.0</object>
<displayvalue>CPU 5sec Busy</displayvalue>
<description>CPU 5/Sec Busy indicator</description>
<shortdescription/>
<comment>type=java.lang.int</comment>
<unit>CPU</unit>
<limitmode>1</limitmode>
<limitmaxerror>95</limitmaxerror>
<limitmaxwarning>75</limitmaxwarning>
<limiterrormsg>CPU 5/sec at unacceptable level</limiterrormsg>
<limitwarningmsg>CPU 5/sec approaching unacceptable level</limitwarningmsg>
</attribute>
<attribute>
<object>1.3.6.1.4.1.9.2.1.57.0</object>
<displayvalue>CPU 1min Busy</displayvalue>
<description>CPU 1min Busy indicator</description>
<shortdescription/>
<comment>type=java.lang.int</comment>
<unit>CPU</unit>
<limitmode>1</limitmode>
<limitmaxerror>95</limitmaxerror>
<limitmaxwarning>75</limitmaxwarning>
<limiterrormsg>CPU 1min at unacceptable level</limiterrormsg>
<limitwarningmsg>CPU 1min approaching unacceptable level</limitwarningmsg>
</attribute>
</attributes>
</entry>
</entries>
</profile>
<!-- ************************************* -->
<profile>
<name>Profile: Cisco CPU Busy[12.0.3-5]</name>
<kind>mjsnmpciscocpuold1205sensor</kind>
<tag>mjmxsensor,mjsnmpesensor</tag>
<description>Cisco CPU IOS [12.0.3-5]</description>
<baseclass>com.paessler.prtg.jmx.sensors.SNMPSensor</baseclass>
<help>Monitors CISCO CPU Busy OIDs[ios 12.0.3 - 12.2.5] </help>
<entries>
<entry>
<object>Custom SNMP Object</object>
<displayvalue>Custom SNMP Display</displayvalue>
<description>SNMP: Custom</description>
<shortdescription>SNMP:Junk</shortdescription>
<help>Custom SNMP Obj, Help</help>
<attributes>
<attribute>
<object>1.3.6.1.4.1.9.9.109.1.1.1.1.4.0</object>
<displayvalue>CPU Tot 1min Busy</displayvalue>
<description>CPU cpmCPUTotal1min Busy indicator</description>
<shortdescription/>
<comment>type=java.lang.int</comment>
<!--unit>{BANDWIDTH|MEMORY|DISK|FILE|TIME_RESPONSE|TIME_SECONDS|TIME_HOURS|TEMP|PERCENT|COUNT|CPU|CUSTOM}</unit-->
<unit>CPU</unit>
<!--customunit>Custom Unit name like "Unicorns"</customunit>
<enabled>true</enabled>
<mpy>1.0</mpy>
<div>1.0</div-->
<limitmode>1</limitmode>
<limitmaxerror>95</limitmaxerror>
<limitmaxwarning>75</limitmaxwarning>
<limiterrormsg>CPU 1min at unacceptable level</limiterrormsg>
<limitwarningmsg>CPU 1min approaching unacceptable level</limitwarningmsg>
</attribute>
<attribute>
<object>1.3.6.1.4.1.9.9.109.1.1.1.1.3.0</object>
<displayvalue>CPU 5sec Busy</displayvalue>
<description>CPU 5/Sec Busy indicator</description>
<shortdescription/>
<comment>type=java.lang.int</comment>
<unit>CPU</unit>
<limitmode>1</limitmode>
<limitmaxerror>95</limitmaxerror>
<limitmaxwarning>75</limitmaxwarning>
<limiterrormsg>CPU 5/sec at unacceptable level</limiterrormsg>
<limitwarningmsg>CPU 5/sec approaching unacceptable level</limitwarningmsg>
</attribute>
<attribute>
<object>1.3.6.1.4.1.9.9.109.1.1.1.1.5.0</object>
<displayvalue>CPU 5min Busy</displayvalue>
<description>CPU 5min Busy indicator</description>
<shortdescription/>
<comment>type=java.lang.int</comment>
<unit>CPU</unit>
<limitmode>1</limitmode>
<limitmaxerror>95</limitmaxerror>
<limitmaxwarning>75</limitmaxwarning>
<limiterrormsg>CPU 5min at unacceptable level</limiterrormsg>
<limitwarningmsg>CPU 5min approaching unacceptable level</limitwarningmsg>
</attribute>
</attributes>
</entry>
</entries>
</profile>
<!-- ************************************* -->
<profile>
<name>Profile: Cisco CPU Busy [12.2(3.5)+]</name>
<kind>mjsnmpciscocpu12235sensor</kind>
<tag>mjmxsensor,mjsnmpesensor</tag>
<description>Test of Custom OIDs Profile</description>
<baseclass>com.paessler.prtg.jmx.sensors.SNMPSensor</baseclass>
<help>Monitors CISCO CPU Busy OIDs[ios 12.2(3.5)] </help>
<entries>
<entry>
<object>Custom SNMP Object</object>
<displayvalue>Custom SNMP Display</displayvalue>
<description>SNMP: Custom</description>
<shortdescription>SNMP:Junk</shortdescription>
<help>Custom SNMP Obj, Help</help>
<attributes>
<attribute>
<object>1.3.6.1.4.1.9.9.109.1.1.1.1.7.0</object>
<displayvalue>CPU Tot 1min Busy</displayvalue>
<description>CPU cpmCPUTotal1min Busy indicator</description>
<shortdescription/>
<comment>type=java.lang.int</comment>
<!--unit>{BANDWIDTH|MEMORY|DISK|FILE|TIME_RESPONSE|TIME_SECONDS|TIME_HOURS|TEMP|PERCENT|COUNT|CPU|CUSTOM}</unit-->
<unit>CPU</unit>
<!--customunit>Custom Unit name like "Unicorns"</customunit>
<enabled>true</enabled>
<mpy>1.0</mpy>
<div>1.0</div-->
<limitmode>1</limitmode>
<limitmaxerror>95</limitmaxerror>
<limitmaxwarning>75</limitmaxwarning>
<limiterrormsg>CPU 1min at unacceptable level</limiterrormsg>
<limitwarningmsg>CPU 1min approaching unacceptable level</limitwarningmsg>
</attribute>
<attribute>
<object>1.3.6.1.4.1.9.9.109.1.1.1.1.6.0</object>
<displayvalue>CPU 5sec Busy</displayvalue>
<description>CPU 5/Sec Busy indicator</description>
<shortdescription/>
<comment>type=java.lang.int</comment>
<unit>CPU</unit>
<limitmode>1</limitmode>
<limitmaxerror>95</limitmaxerror>
<limitmaxwarning>75</limitmaxwarning>
<limiterrormsg>CPU 5/sec at unacceptable level</limiterrormsg>
<limitwarningmsg>CPU 5/sec approaching unacceptable level</limitwarningmsg>
</attribute>
<attribute>
<object>1.3.6.1.4.1.9.9.109.1.1.1.1.8.0</object>
<displayvalue>CPU 5min Busy</displayvalue>
<description>CPU 5min Busy indicator</description>
<shortdescription/>
<comment>type=java.lang.int</comment>
<unit>CPU</unit>
<limitmode>1</limitmode>
<limitmaxerror>95</limitmaxerror>
<limitmaxwarning>75</limitmaxwarning>
<limiterrormsg>CPU 5min at unacceptable level</limiterrormsg>
<limitwarningmsg>CPU 5min approaching unacceptable level</limitwarningmsg>
</attribute>
</attributes>
</entry>
</entries>
</profile>

</profiles>
4 changes: 2 additions & 2 deletions src/com/paessler/prtg/jmx/sensors/PingSensor.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ protected DataResponse calcStats(DataResponse response, List<IcmpPingResponse> p
response.addChannel(lchannel);
if(stats.max < stats.min) {lchannel.setWarning(1); errcnt++;}
FloatChannel fchannel = new FloatChannel("Ping Time Avg", Channel.UNIT_STR_TRESPONSE, stats.avg);
if(stats.avg < 0) {lchannel.setWarning(1); errcnt++;}
// if(stats.avg < 0) {lchannel.setWarning(1); errcnt++;}
response.addChannel(fchannel);
lchannel = new LongChannel("Ping Time Max", Channel.UNIT_STR_TRESPONSE, stats.max);
if(stats.max < stats.min) {lchannel.setWarning(1); errcnt++;}
Expand All @@ -164,7 +164,7 @@ protected DataResponse calcStats(DataResponse response, List<IcmpPingResponse> p
lchannel = new LongChannel("Packet Loss", Channel.UNIT_STR_PERCENT, stats.loss);
response.addChannel(lchannel);

if(stats.cnt == stats.cnt){
if(stats.cnt == stats.loss){
lchannel.setWarning(1);
if(errcnt > 1) {response = getErrorResponse("Error", -1, "100 % Packet Loss");}
else {response.setMessage("100 % Packet Loss");}
Expand Down
2 changes: 1 addition & 1 deletion src/com/paessler/prtg/jmx/sensors/dns/DNSLookupEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public DNSLookupEntry(){
this.name = null;
}
public DNSLookupEntry(String name, int type) throws TextParseException{
this.name = new Name(name);
this.name = new Name(name.trim());
this.type = type;
}
public DNSLookupEntry(String name, String type) throws TextParseException{
Expand Down
8 changes: 4 additions & 4 deletions src/com/paessler/prtg/jmx/sensors/profile/Entry.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class Entry implements Comparable<Entry> {
public Object addProperty(PropertyEntry prope)
{return propMap.put(prope.getName(), prope.getValue());}
// ------------------------------------------------------------
public List<Attribute<?>> attributes = new Vector<Attribute<?>>();
public List<Attribute<String>> attributes = new Vector<Attribute<String>>();

// --------------------------------
public String getObject() {return object;}
Expand All @@ -77,11 +77,11 @@ public void setComment(String comment) {
}
// --------------------------------

public List<Attribute<?>> getAttributes() {return attributes;}
public void setAttributes(List<Attribute<?>> attributes) {
public List<Attribute<String>> getAttributes() {return attributes;}
public void setAttributes(List<Attribute<String>> attributes) {
this.attributes = attributes;
}
public void addAttribute(Attribute<?> attribute) {
public void addAttribute(Attribute<String> attribute) {
this.attributes.add(attribute);
}
// --------------------------------
Expand Down
5 changes: 3 additions & 2 deletions src/com/paessler/prtg/jmx/sensors/snmp/SNMPEntry.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.paessler.prtg.jmx.sensors.snmp;

import java.util.List;
import java.util.Vector;

import org.snmp4j.PDU;
Expand Down Expand Up @@ -170,15 +171,15 @@ public Channel getChannel(Variable var){
}

//----------------------------------------------------------------------
public static void addVariableBindings(PDU pdu, Vector<SNMPEntry> vect){
public static void addVariableBindings(PDU pdu, List<SNMPEntry> vect){
OIDHolder tmp;
for(SNMPEntry curr :vect){
pdu.add(new VariableBinding(curr.getOid()));
}

}
// -----------------------------------------------------------
public static PDU getPDU(Vector<SNMPEntry> vect){
public static PDU getPDU(List<SNMPEntry> vect){
PDU retVal = new PDU();
addVariableBindings(retVal, vect);
return retVal;
Expand Down
Binary file modified target/JMXMiniProbe.jar
Binary file not shown.

0 comments on commit 3e2ab51

Please sign in to comment.