5 Replies Latest reply: Sep 5, 2013 9:06 AM by romeyde RSS

Alert Manager - Call CGI every poll

romeyde

We are trying to make a frontend for WPM outside of the product.  To do this, I am trying to call a cgi script to have wpm report the status of each monitor every time it is ran.

 

I created a new alert and set it to trigger anytime the status is not empty.

This got me what I wanted but then it stopped updating.    So I tried putting in a reset condition and set it to also trigger if 'status is not empty'.

This doesn't seem to have helped though...

 

What should the "Trigger Conditions" and "Reset Conditions" be to get my cgi script called every time a transaction runs, whether or not the status has changed since the last poll?

 

Thanks,

Derek

 

 

BTW...   Is there a URL (xml or not) that can be called that would show the current status of all transactions that I can parse?   This would be simpler than generating alerts for every poll.

 

 

I did figure out that I could put a reset condition in also and have it call the same CGI script.   So now, every minute, my log file (that is created by the cgi script) is getting updated with the current status of every transaction.

Not ideal.  But useable.  

 
  • Re: Alert Manager - Call CGI every poll
    lukas.cerny

    Hello Derek,

     

    In order to be able to say that transaction was played back, you need to keep information about when the previous playback was performed so the comparison can be made. I'm afraid that this feat is out of the scope that alerting engine is able to handle. So the solution that you have now (alert triggered and reset every minute, calling the CGI script) is most likely the only reasonable one that can be achieved by alerting.

     

    However you can try to leverage Orion SDK for access to this data directly through SWIS, the Orion SDK provides tools that will allow you to connect directly to the Information Service which provides data for the website. The Orion SDK can be downloaded from here. Or if for whatever reason you can't use Orion SDK you could try to use web service that is used for querying data by /Orion/Admin/swis.aspx page.

     

    Let me know if you have any questions.

     

    Lukas

    • Re: Alert Manager - Call CGI every poll
      romeyde

      Calling my cgi script every minute is actually working well.   I end up with a 20mb file by the end of the day, but it's manageable.

      I do seem to be having an issue with 'unmanaged' monitors though.   Nothing I put in the alert manager seems to be triggering a call to the cgi-script for monitors that are turned off.

      I'd like to not just get triggers when a monitor is up or down, but also if it is unmanaged and keep reporting that every minute while true.

      Is that possible?   I've played with the "Status", "Last Played" and "Is Unmanaged" keys to no avail.

      • Re: Alert Manager - Call CGI every poll
        lukas.cerny

        The alert actions are not by default executed for unmanaged entities. This setting however can be suppressed, even though I don't recommend to do that (because it will affect all defined alerts). If you want to suppress this behavior, you will need to update one setting in the Orion database. In the dbo.Settings table find row with SettingID='AlertEngine-ProcessUnmanagedObjects' and set value in the CurrentValue column to 1. After restarting the SolarWinds Alerting Engine service, alert actions should be triggered also for unmanaged entities.

         

        Instead of this solution I strongly recommend to leverage the Orion SDK if possible.

        • Re: Alert Manager - Call CGI every poll
          romeyde

          Thanks.   I looked at the SDK earlier but wasn't quite able to wrap my head around it.   I work primarily with perl and work best with example scripts that I can modify as needed.

          I'll take another look at it.

        • Re: Alert Manager - Call CGI every poll
          romeyde

          Wasn't as hard as I expected it to be.  Managed to download SDK to a windows box, unpack .msi and then copy the .pm files to a linux box.   Tweaked the sample a bit and got this to work:

           

          print $swis->QueryXml('SELECT Name,StatusDescription FROM Orion.SEUM.Transactions');

          print $swis->QueryXml('SELECT Name FROM Orion.SEUM.Transactions WHERE Unmanaged=1');


          Seems to be giving me what I need and much faster/elegant than sending out alerts every minute to a cgi script.


          Thanks.