Monitoring RestApi

Hi everyone,

This question is a little bit technical and I hope that I can explain it right.

We want to monitor a lot of rest api’s and I have created a powershell script for this.

In scom I need to target this script to a class and with mpauthor and a fragment from Kevin Holman, I have created a discovery and class based on a file that exist on a linux server where I need to request the rest api. Every powershell monitor that I target to this class is sitting under the same instance of this class, that one linux server.

What I need is one class for each web url that I need to request. How can I create this sub classes, maybe also with mpauthor?

I hope that my question is clear.

Thanks,

Luc

1 Like

You could try creating an Enterprise Application for each one, and using the availability monitor to test the URL?

Hi Luc,

I do not know MPAuthor good enough, but if you can Export and Import XML, you can try something like this:

<ClassType ID="Network.SolarWinds.NPM.Node" Accessibility="Public" Abstract="true" Base="System!System.LogicalEntity" Hosted="false" Singleton="false" Extension="false">
  <Property ID="NodeID" Type="string" AutoIncrement="false" Key="true" CaseSensitive="false" MaxLength="256" MinLength="0" Required="false" Scale="0" />
  <Property ID="NodeCaption" Type="string" AutoIncrement="false" Key="false" CaseSensitive="false" MaxLength="256" MinLength="0" Required="false" Scale="0" />
  <Property ID="AgentIP" Type="string" AutoIncrement="false" Key="false" CaseSensitive="false" MaxLength="256" MinLength="0" Required="false" Scale="0" />
</ClassType>

<ClassType ID="Network.SolarWinds.NPM.Switch" Accessibility="Public" Abstract="false" Base="Network.SolarWinds.NPM.Node" Hosted="false" Singleton="false" Extension="false" />
<ClassType ID="Network.SolarWinds.NPM.CoreSwitch" Accessibility="Public" Abstract="false" Base="Network.SolarWinds.NPM.Node" Hosted="false" Singleton="false" Extension="false" />
<ClassType ID="Network.SolarWinds.NPM.ArubaController" Accessibility="Public" Abstract="false" Base="Network.SolarWinds.NPM.Node" Hosted="false" Singleton="false" Extension="false" />

It shows a “parent class” named Network.SolarWinds.NPM.Node and then 3 “children”:

…Switch, …CoreSwitchand ArubaController.

Hope this helps :slight_smile:

 

Ruben

Hi Luc,

I would store the information about the URLs in a CSV file. Beside of the URL you should also add a Key element that needs to be unique. Use PowerShell “new-guid” for example to get some.

Then, please check the following web site as example. It shows how to discover based on CSV file:

https://secureinfra.blog/2015/12/01/scom-advanced-authoring-powershell-discovery-from-csv-file-explained-using-tcp-port-monitoring-scenario/

Thanks for your answer, but I think the structure of an EA is to big for just one web request.

Hi Ruben, Thanks for your answer.
My parent class is a linux servers with a base class of Linux Computer, discovered on the existing of a file on that server (I’ve used a fragment from Kevin Holman for this).
Now I want a class for each url that I have to monitor (restapi) because the powershell monitoring script is different for each. I can create child classes like you do, but what about the discovery of these url’s (objects). How do I do this?

Regards,
Luc

Thanks Ruben, I will give it a try next week.