Scheduled task policy
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:
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!
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.
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.