0 Replies Latest reply on Oct 12, 2010 10:50 AM by unixbeard

    External process monitor calling Powershell script not updating

      I'm attempting to monitor that the VPN connection between two servers is up, so I've created a Powershell script which connects to one, instructs it to test the connection to the other, and then output the result as either 1 for success or 2 for failure. In IPMonitor (8.5) I've created an External Process monitor which calls that script, and initially seems to work, eg it shows success and confirms the return value was 1.

      To be certain, I updated the ps1 script to point to a non-existant IP address, and confirmed from Powershell that it now reports a failure. IPMonitor however continues to report it as successful. I've even tried renaming the ps1 file, yet even though the script is no longer there, IPMonitor continues to report that it is testing and the test is being successful.

      Does IPMonitor cache the script it is calling or something, or does anyone have any other suggestions for what might be happening?

      The Powershell script I'm calling is :

      $username = "server\ipmonitor"
      $password = ConvertTo-SecureString "password" -AsPlainText -Force
      $myCred = New-Object System.Management.Automation.PSCredential $username, $password
      if (test-connection -computername 192.168.1.1 -source 192.168.2.1 -Credential $myCred -Quiet)
      {write-host "1"}
      else {write-host "2"}

      and my monitor settings are :

      Executable Name : powershell.exe
      Directory : c:\windows\system32\WindowsPowerShell\v1.0\
      Command Line Parameters : vpntest.ps1
      Startup Directory : c:\batchscripts\
      Credential for Monitoring : [No Credential]
      Compare the Process Return Value : selected
      Expectged Return Value : 1

      Thanks
      Keith