Kaseya Community

Create Alarm from Script

  • Hi,

    Just working on a script that I want to create an alarm based on a variable. I'm happy to call a second script and use the if function, just wanted to know how I can create the alarm from the script.

    Ideally, if I can pick the catergory for the alarm, that would be even better.

    Thanks in advance,
    Chris


    Legacy Forum Name: Create Alarm from Script,
    Legacy Posted By Username: thou
  • Hello Thou,

    Not sure if this is what you are looking for, but you could always write an Event Log entry using the command Eventcreate, and then monitor for that event log entry with an alert. Here'san example:



    Script Name: TestFailureAlert
    Script Description: This is a test script that will check a parameter with the IF statement, and if TRUE, will create a list of c:\temp. IF FALSE, it will write an event to the Application Event Log using the EVENTCREATE command.

    IF Service is Running
    Parameter 1 : Alerter
    THEN
    Execute Shell Command
    Parameter 1 : dir c:\temp >>c:\temp\dirlist.txt
    Parameter 2 : 1
    OS Type : 0
    ELSE
    Execute Shell Command
    Parameter 1 : eventcreate /l application /t error /id 1000 /so "My MSP Name" /d "This is a test Application Event Log Error used for monitoring only."
    Parameter 2 : 1
    OS Type : 0



    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: gssloan