New Ranks & Badges For The Community!
Notice something different? The ranks and associated badges have gone "Star Fleet". See what they all mean HERE
Highlighted
Absent Member.. Absent Member..
Absent Member..
428 views

Scheduled task policy

Hi,

I wish to monitor a certain commands output from a agent host. Lets say for example that I want to run the command ipconfig and the output is as:


Windows IP Configuration

Ethernet adapter Local Area Connection:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::7068:b11f:4fdb:c221%10
   IPv4 Address. . . . . . . . . . . : 192.168.80.81
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.80.1

There I want to make sure that the line starting with "Default Gateway" has a string "192.168.80.1".

I am able to use Scheduled Task policy to run a Command, VB Script or Perl Script. So running ipconfig command as Command is easy but I then I cannot use or search the output for any patterns.

I am not that familiar with VB or Perl scripts. I know how to create a simple VBScript which runs the ipconfig command and creates a output file put how to get the output to OMi and search the pattern and create a event if pattern is found or not found is beyond me. Here is the VBScript I created:

Dim objShell
Set objShell = WScript.CreateObject ("WScript.shell")
objShell.run "cmd /K CD C:\ & ipconfig > c:\temp\output.txt"
Set objShell = Nothing

Any help on how to achieve this?

Appreciate the help!

BR,

N

Labels (1)
0 Likes
2 Replies
Highlighted
Fleet Admiral Fleet Admiral
Fleet Admiral

best approach would be to use logfile monitoring policy with preprocessing option. preprocessing allow you to run any command/script whose output can be redirected to a text file like you are redirecting it to output.txt, you can also create a logfile from your script and then read this logfile for pattern matching purpose.

 

this screenshot is taken from OMW server but other than GUI there should not be any difference in configuring from OMI.

HTH
-KAKA-

0 Likes
Highlighted
Cadet 2nd Class Cadet 2nd Class
Cadet 2nd Class

Hi,

To achieve this kind of monitoring, SPI for Systems Infrastructure product has the capability of monitoring command outputs with the policy Change Configuration Monitor. Currently this feature is available with Infrastructure SPI, not with Infra MP.

If you provide the command which you want to monitor to this policy, If there is any change in output, then policy will alert you with the changes.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.