powershellmonitoringtoolkitgeneos

ITRS Geneos Toolkit Plugin


I have a request to check for a file modification time if its more that 10 minutes. it should alert in ITRS as well as send a mail. The netprobe is installed on Windows. I have tried to use use Toolkit plugin and placed a powershell script in the samplescript section like "powershell -command path\filename" and in the Advanced section randomly put the filename as "test.txt" and when am trying to sample its showing "script path not found"

 $source="C:\Users\Desktop\manoj.txt"
    $Now=GET-DATE
    $ModTime=(Get-ItemProperty -path $source -Name LastWriteTime).lastwritetime
    "Filename,Sysdate,Last Modified,Time difference
    $source,$now,$ModTime,$TimDiff"|ConvertTo-Csv -NoTypeInformation

Requirements

  1. how to pass powershell command in "samplescript section"
  2. how to get the output of the powerscript to the geneos
  3. codes to send mail from geneos
  4. a sample code showing creating rules for a column

Thanks in advance!!!


Solution

    1. Use plugin as FKM to monitor the file. In the advanced section of the sampler, chose to display the file modified time.
    2. Define an 'Action' that sends email
    3. Define a rule on the file modified time and run the action defined in step 2 when the value exceeds 600 seconds.

    Sample rule:
    If value > 600 then
    Severity critical
    Run action_name
    Else
    Severity ok
    endif