ScienceLogic / EM7 – Monitoring VMware vShield Edges – Part 1

This is a two part series, and the scripts used in this are for information only, you will need to make changes to the scripts in order to use them.

If like the company I work for you happen to use ScienceLogic EM7 as your monitoring tool, and you make use of VMware vShield Edges for your customer edges, then like us you have probably run into a an issue where an edge fails in such a way that ScienceLogic EM7 doesn’t report the edge down. I decided to write a snippet to check the status of the edge.

Now the first issue is that although Science Logic EM7 detects the vShield edges via vCenter, it has no idea that they are infact vShield edges, as far as ScienceLogic is concerned they are just virtual machines. This is also true of vCenter, and does explain why there is no easy way of matching “Edge-Id’s” to ScienceLogic EM7 device entries.
So the first thing we need to do is have an easy way of linking the ScienceLogic EM7 device entries, to a vShield “Edge-id”, this will allow our status checking script to run against the correct vShield manager.

(If your environment only has a single vShield Manager, skip to the end and grab the single manager copy of the script.)

So firstly, we need to extend the ScienceLogic EM7 device schema to contain two additional fields, I have named them c-edge_id and c-edge_manager, they will contain the edge-id (used by vShield manager to identify the edge), and c-edge_manager which simply contains the DNS name on which that edge exists.

To extend the schema, you need to post against the api, i used the below (CAUTION, this will remove any CURRENT custom attributes, if you have current custom attributes, you need to add them to the below code.);

Once done, you now need a script that runs through all your devices and adds the required information. I would recommend coming up with a naming convention to make this task easier, all our Edges are named vse-xxx. So we only look for those devices in the database.