Skip to content

Commit

Permalink
Merge pull request #243 from OpenNMS/jira/NMS-7213
Browse files Browse the repository at this point in the history
Merged fix for issue NMS-7213
  • Loading branch information
opennms-bamboo committed Mar 17, 2015
2 parents 4b48d40 + 478d699 commit c9c10dc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
Expand Up @@ -41,7 +41,6 @@
import com.vmware.vim25.HostRuntimeInfo;
import com.vmware.vim25.HostSystemPowerState;
import com.vmware.vim25.mo.HostSystem;

import org.exolab.castor.xml.MarshalException;
import org.exolab.castor.xml.ValidationException;
import org.opennms.core.spring.BeanUtils;
Expand Down Expand Up @@ -134,6 +133,8 @@ public PollStatus poll(MonitoredService svc, Map<String, Object> parameters) {
}
}

boolean ignoreStandBy = getKeyedBoolean(parameters, "ignoreStandBy", false);

OnmsNode onmsNode = m_nodeDao.get(svc.getNodeId());

// retrieve the assets and
Expand Down Expand Up @@ -242,7 +243,11 @@ public PollStatus poll(MonitoredService svc, Map<String, Object> parameters) {
serviceStatus = PollStatus.unavailable(reason.toString());
}
} else {
serviceStatus = PollStatus.unresponsive("Host system's power state is '" + powerState + "'");
if (ignoreStandBy && "standBy".equals(powerState)) {
serviceStatus = PollStatus.up();
} else {
serviceStatus = PollStatus.unresponsive("Host system's power state is '" + powerState + "'");
}
}

vmwareViJavaAccess.disconnect();
Expand Down
Expand Up @@ -34,7 +34,6 @@
import com.vmware.vim25.VirtualMachineRuntimeInfo;
import com.vmware.vim25.mo.HostSystem;
import com.vmware.vim25.mo.VirtualMachine;

import org.exolab.castor.xml.MarshalException;
import org.exolab.castor.xml.ValidationException;
import org.opennms.core.spring.BeanUtils;
Expand Down Expand Up @@ -103,6 +102,8 @@ public PollStatus poll(MonitoredService svc, Map<String, Object> parameters) {
}
}

boolean ignoreStandBy = getKeyedBoolean(parameters, "ignoreStandBy", false);

OnmsNode onmsNode = m_nodeDao.get(svc.getNodeId());

// retrieve the assets and
Expand Down Expand Up @@ -194,7 +195,11 @@ public PollStatus poll(MonitoredService svc, Map<String, Object> parameters) {
if ("poweredOn".equals(powerState)) {
serviceStatus = PollStatus.available();
} else {
serviceStatus = PollStatus.unavailable("The system's state is '" + powerState + "'");
if (ignoreStandBy && "standBy".equals(powerState)) {
serviceStatus = PollStatus.up();
} else {
serviceStatus = PollStatus.unavailable("The system's state is '" + powerState + "'");
}
}

vmwareViJavaAccess.disconnect();
Expand Down
Expand Up @@ -193,10 +193,12 @@
<service name="VMwareCim-HostSystem" interval="300000" user-defined="false" status="on">
<parameter key="retry" value="2"/>
<parameter key="timeout" value="3000"/>
<parameter key="ignoreStandBy" value="false"/>
</service>
<service name="VMware-ManagedEntity" interval="300000" user-defined="false" status="on">
<parameter key="retry" value="2"/>
<parameter key="timeout" value="3000"/>
<parameter key="ignoreStandBy" value="false"/>
</service>

<downtime interval="30000" begin="0" end="300000" /><!-- 30s, 0, 5m -->
Expand Down

0 comments on commit c9c10dc

Please sign in to comment.