This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

IP Monitor SOAP API - MonitorEdit MonitorAdd Setting Parameter

I'm curious if anyone can provide any details about the Settings parameter of the MonitorAdd and MonitorEdit methods within the ipMonitor 7.0 configuration interface?

I have been successful at requesting information from the SOAP API using PHP and NuSoap.

Below is a sample of my code:

require_once('nusoap-php5-0.9/lib/nusoap.php');

$wsdl="ipm7config.wsdl"; // local copy of wsdl with last line of wsdl updated to my IP Monitor server  <soap:address location="http://[my server ip]/soap/config.asmx" />

$client=new soapclientNusoap($wsdl, true);

$result = $proxy->MonitorListDesc(null); // provides a list of all monitors

$result = $proxy->MonitorView(array('mon_id'=>'1000000')); // provides monitor details for the selected monitor id

// Here I form an array type similar to the output of MonitorView

$SETTINGS['monitor']['id'] = "1000000";
$SETTINGS['monitor']['typeid'] = "6";
$SETTINGS['monitor']['parentid'] = "300022";
$SETTINGS['monitor']['nv']['ui']['name'] = "My Monitor - HTML - ID# 999";
$SETTINGS['monitor']['nv']['addr'] = "192.168.0.1";
$SETTINGS['monitor']['nv']['port'] = "80";
$SETTINGS['monitor']['nv']['url'] = "/";
$SETTINGS['monitor']['nv']['search'] = "my search term";
$SETTINGS['monitor']['nv']['retvalue'] = "0";
$SETTINGS['monitor']['nv']['failiffound'] = "false";
$SETTINGS['monitor']['notifyfailures'] = "2";
$SETTINGS['monitor']['maxalerts'] = "65535";
$SETTINGS['monitor']['maxtest'] = "10";
$SETTINGS['monitor']['testing']['up'] = "60";
$SETTINGS['monitor']['testing']['warn'] = "2";
$SETTINGS['monitor']['testing']['down'] = "2";
$SETTINGS['monitor']['testing']['lost'] = "2";
$SETTINGS['monitor']['stats']['enabled'] = "true";
$SETTINGS['monitor']['enabled'] = "true";

$result = $proxy->MonitorEdit(array('Settings'=>$SETTINGS));

To date, I've been unable to get the MonitorAdd or MonitorEdit method call to successfully return.  I'm confident it's due to the fact that I have not set up the struct Settings parameter correclty.  The API documentation is weak and it lacks any details on formatting the settings parameter.  I've even tried to send in an XML string for Settings to no avail like below.  I've contacted Solar Winds and spoke to Chris Foley but their stand reply is we don't support the API anymore.  All I need to know is how the Settings parameter needs to be passed into the MonitorAdd or MonitorEdit methods!!!!

 

 

<monitor>
<id>1000000</id>
<typeid>6</typeid>
<parentid>300022</parentid>
<nv>
<ui>
<name>My Monitor - HTML - ID# 999</name>
<server></server>
</ui>
<retvalue>0</retvalue>
<cred>
<monitoring></monitoring>
<alerting></alerting>
</cred>
<addr>192.168.0.1</addr>
<port>80</port>
<url>/</url>
<search>my search term</search>
<failiffound>false</failiffound>
<follow>false</follow>
<headrequest>false</headrequest>
<useproxy>false</useproxy>
</nv>
<testing>
<up>60</up>
<warn>2</warn>
<down>2</down>
<lost>2</lost>
</testing>
<stats>
<enabled>true</enabled>
</stats>
<enabled>true</enabled>
<maxtest>10</maxtest>
<notifyfailures>2</notifyfailures>
<maxalerts>65535</maxalerts>
</monitor>

  • wrap the xml in an <export> tag before sending it back to ipmonitor.  I think I read that way back in the 7.x or something.

     

    Example <export><monitor>...</monitor></export>

  • Ok I'll give that a try and create the necessary struct type the service requires since it does not support a string of XML for the parameter to MonitorAdd/Edit.

    ie:

    $SETTINGS['export']['monitors']...

  • We got it to work!!!!

    Below is a sample php5 / nusoap-php5-0.9 implementation for MonitorAdd

     

    require_once('nusoap.php');

    $wsdl="ipm7config.wsdl"; // local wsdl file with last line of wsdl confgured to match our IPMonitor server location: <soap:address location="http://[MY_SERVER_IP]/soap/config.asmx" />

    $client = new soapclientNusoap($wsdl, true);

    $request = "<MonitorEdit xmlns=\"">schemas.ipmonitor.com/.../parentid><nv><ui><name>My Monitor Name</name></ui><addr>10.0.0.1</addr><port>80</port><url>/</url><search>page loaded</search><retvalue>0</retvalue><failiffound>false</failiffound></nv><notifyfailures>2</notifyfailures><maxalerts>65535</maxalerts><maxtest>10</maxtest><testing><up>60</up><warn>2</warn><down>2</down><lost>2</lost></testing><stats><enabled>true</enabled></stats><enabled>true</enabled></monitors></Settings></MonitorEdit>";

    $result = $client->call('MonitorEdit', $request);

    //$result returns boolean(true) if successful

  • I'm not sure how bbauer got this to work without the rest of the envelope, but in case this helps anyone, here's what I was able to confirm works.

    The definition at http://schemas.ipmonitor.com/ipm70/MonitorEdit.htm should have MonitorEdit instead of GroupEdit.

    So to get this to work, use MonitorView to get an example config from the server, then use MonitorEdit to push the update back.

    The xml structure should look like this:

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope ...>
      <soap:Body>
        <MonitorEdit xmlns="...">
          <Settings>
            <monitors xmlns="...">
              <typeid>...</typeid>
              ...
            </monitors>
          </Settings>
        </MonitorEdit>
      </soap:Body>
    </soap:Envelope>