Kaseya Community

How to trigger a script or other action based on a system parameter or snmp value?

  • I would like to explore self-healing by triggering other actions within Kaseya. For example, if a monitor is set on disk space, if disk space goes below a certian limit,it can not only send an alert, but also initiate a disk cleanup script or other script that coudl automatically write a script log entry such as "disk space below 10%, Drive X: currently has X free space, ran cleanup script, now has X free space (x%)".

    One of the greatest example where this could prove to be extremely valuable is with Exchange Server. Exchange will keep logging itself into a brick wall and then crash. No alerts will be sent since services don't always stop, but connections to the server cease immediately. The client knows WAY before you will get any kind of notification. It would be nice to have a disk space trigger that will automatically delete the transaction logs, freeing up space and avoiding the crash altogether. The script log will show the frequency and outcome, so the more entries, the more critical it is to get the client to expand their hard drive capacity to cope with Exchange's growth.

    Another cool one could be an event trigger for virus protection. If event X is found within the past 24 hours, then trigger a virus scan and clean job for that machine. Maybe even a process monitor that could look for known "bad" processes that would trigger a script to stop the process, uninstall the known application, run an adware scan, etc. If X events of a certian type have been triggered, create a ticket. The list could go on and on. Has anyone had success in doing this?


    Legacy Forum Name: How to trigger a script or other action based on a system parameter or snmp value?,
    Legacy Posted By Username: elehman
  • I have often thought of these items myself. Currently, I am dealing with "The device, \Device\Ide\IdePort1, did not respond within the timeout period."

    I'd LOVE to be able to initiate a chkdsk right from that alert and only alert me if it couldn't fix it itself.


    Legacy Forum Name: Self Healing Scripts,
    Legacy Posted By Username: adamsteinhoff
  • You can do this already ... set an application event for the error meesage and then set a script to run that runs chkdsk /r and VOILA - all set - self healing ...



    You can do the same for the less than 10% disk space as well ....


    Legacy Forum Name: Self Healing Scripts,
    Legacy Posted By Username: tom@tbkconsulting.biz
  • tom@tbkconsulting.biz wrote:
    You can do this already ... set an application event for the error meesage and then set a script to run that runs chkdsk /r and VOILA - all set - self healing ...



    You can do the same for the less than 10% disk space as well ....


    What if it's the D: drive? Doesn't chkdsk/diskclean check the systemdrive by default? How can I parse the error message to be specific with the command that needs to be run without having three different alert sets?

    Adam


    Legacy Forum Name: Self Healing Scripts,
    Legacy Posted By Username: adamsteinhoff
  • CHKDSK [volume[[path]filename]]] [/F] [/V] [/R] [/X] [/I] [/C] [/L[:size]] [/B]

    You can use chkdsk /? to get the explanations, but yes you'd have to either run 3 different alert sets to make it self healing for different drives.

    cleanmgr I think is not drive depenedent, I think it works across all drives on the system, but am not sure on this - one of the more advanced knowledge guys would have to answer this ...


    Legacy Forum Name: Self Healing Scripts,
    Legacy Posted By Username: tom@tbkconsulting.biz