But wouldn’t it be nice to have an option to export the devices as well? Into the same format (IP address and friendly name) so when the list of devices in the MP gets corrupted or damaged in any kind of way, one is easily back on track again by importing the latest export file?
Yesterday I visited a customer of mine. One of his system engineers bumped into the issue where the list of devices got corrupted so he was forced to add many of the devices by hand since the import list – originally used - wasn’t up to date any more.
Since he is a real script kiddo, he built a PS-script which exports the list of devices present in the OpsLogix Ping MP. This script is managed by Task Scheduler so it runs on a regular basis. That way he has always a backup available in case ‘disaster’ strikes. Some time ago disaster struck again. But now he had this export file, ready to be used. Within a few minutes all the devices were back again!
I asked him whether I am allowed to blog about it and to share his script with the Community. And guess what: he agreed. But he doesn’t want me to mention his name, so let’s call him Mister X. This is his favorite lunch:
All credits go to him. Thank you Mister X! Much appreciated. I owe you a hamburger!
The export functionality comes in two parts:
- A batch files which calls the PS-script;
- The PS-script which exports the devices present in the OpsLogix Ping MP to a file.
The batch file is managed by the Task Scheduler in order to have it run on a scheduled basis. The entries in red need modification:
- The location of the PS-script;
- The name of the RMS;
- The location of the export file.
Batch File:
@echo off |
PS script (opslogix.ps1):
$rootMS="NAME OF RMS" # ======================================================================================== del d:\scripts\opslogix\opslogix.log $mclass = get-monitoringclass -name "OpsLogix.IMP.Ping.Target" |
I am sure many people will appreciate this. Nice!
Of course, before importing the file again, one or more valid Source Hosts must be present.
5 comments:
I'm looking to integrate our asset management system with the OpsLogix Ping MP using powershell to add target clients automatically based on classification of systems in our asset management system and whether or not they are monitored systems in SCOM. Any insight on how that might be accomplished?
Hi Kurt.
What you're looking add is a magnificent example for SCOrch: it connects into your asset management system, makes a cross reference in order to find newly added devices, and when found, start another workflow to add them OpsMgr. This is the overview of course, but SCOrch is certainly the way to go here.
Cheers,
Marnix
Thanks for your response Marnix.
We do not yet have Orchestrator deployed because of lack of resources at this time. If you have any thoughts on how I might be able to automate this outside of Orchestrator using powershell, I'd love to hear them.
All I need is a simple example of how to add/remove a target to/from the OpsLogix MP via powershell. I can figure out the rest.
Hi Kurt.
I am sorry but that kind of information I don't have at hand right now and takes time to get it. And time I don't have at this moment (closing of the year and just a couple of days left before holiday season kicks in :) )
So what you could do instead is to check the PS cmdlets for SCOM/OM and perhaps even contact OpsLogix with your questions. It's their MP and perhaps they can tell you what route to take here.
Cheers,
Marnix
Understand. Thanks for the discussion.
Post a Comment