LabTech Support Forums

Modifying Ignite Scripts Question

This forum is for discussion of expansion script related issues.

Moderator: jware.connectwise

Modifying Ignite Scripts Question

Postby darrell.ping.beinetworks » Fri Apr 19, 2013 3:16 pm

So we are getting TONS of tickets from the Ignite Scripts, which is ok. But there are some we would like to convert to alerts. Is there an easy was to copy/modify the scripts to still do their action (Ex Kill Bad Process or Restart Service) and then send an alert not a ticket? Im pretty new to this scriptting language so dont have all the stuff down. Thanks!

-D
darrell.ping.beinetworks
Newbie
Newbie
 
Posts: 21
Joined: Tue Mar 26, 2013 10:08 am

Re: Modifying Ignite Scripts Question

Postby mware.tabinc » Mon Apr 22, 2013 9:01 am

All (most?) of these scripts are under the Autofix Actions folder. What we did was right click and "copy script" on the script we wanted to override, the edit the copy, and remove / rewrite the ticketing sections to generate alerts instead. That way the original script is still in place and the changes will not get over-written by any Labtech updates.

To change the script from generating tickets to alerts, look for a lines like:
"RUN SCRIPT: _System Automation\Functions\Ticket Comment*"
"RUN SCRIPT: _System Automation\Functions\Ticket Finish*"
"RUN SCRIPT: _System Automation\Functions\Ticket AutoFix Post Time*"
etc...


In the "Monitor Restart Service" script you will see these at lines 26, 48, 50, 55 and 59. In our case we had enough scripting background to restructure the script and remove these sections, but if you are not comfortable doing that, simply change these lines to be either a "Script Log Message" (which would do nothing) or "LTServer Create Alert" to generate the alert message you are looking for.

Once the monitor script is re-written, track down the internal monitor under your service plan groups and use the "edit the Alerts" button to change the script from the LabTech default to the new one.

-Mike
mware.tabinc
Full Member
Full Member
 
Posts: 141
Joined: Wed May 09, 2012 12:16 pm

Re: Modifying Ignite Scripts Question

Postby darrell.ping.beinetworks » Mon Apr 22, 2013 11:56 am

Thank you Mike for the reply.

I will work on removing those Run Script entries and see what happens. :)
So in order to do the Alerts I would change every "Run Script:" line to "LTServer Create Alert"? Or just make one entry with that at the end of the script?

Thanks again! Very new to the scripting in Labtech
darrell.ping.beinetworks
Newbie
Newbie
 
Posts: 21
Joined: Tue Mar 26, 2013 10:08 am

Re: Modifying Ignite Scripts Question

Postby mware.tabinc » Mon Apr 22, 2013 1:01 pm

Well it really depends on the script and what you are looking for. For example with the Monitor Restart Service, we changed it to trigger an alert in the ":AutofixFailded - Label" section (line 55), and got rid of the other lines. That way we only get an alert if the service could not be restarted. If you wanted an informational alert when the script was successful in restarting the service, you would use the "RUN SCRIPT: _[...]\Ticket Finish" at line #50. There is also a "NoAutofix: - Label" section (Line 59) that gets triggered if the Agent has the "Disable Auto Fixes" or "Disable Restart Service" check boxes set on that you could either comment out or generate an alert.

You will have to learn enough about scripting to be able to read through and understand what the sections are doing in order to determine what you want to do with them. The up-side with the copy method is if you do break anything, you can just re-copy and start over.

-Mike
mware.tabinc
Full Member
Full Member
 
Posts: 141
Joined: Wed May 09, 2012 12:16 pm

Re: Modifying Ignite Scripts Question

Postby darrell.ping.beinetworks » Mon Apr 22, 2013 4:43 pm

So I copied the script, created a new alert template and assigned the copied script to it. I then "disable function" on all the Run Script lines and added the Create Alert line on the AutoFixFailed section. I then assigned that template to the 24x7 Workstations group (Which my pc falls under).

I then go into my services and stop a couple auto ones.
I hit inventory - resend services

Under commands I see the update of services completes successfully, however the new script for restarting services is never run. It doesnt show up under my scripts tab at all.. Even if I messed the script up I should still see it show up in there right? It would show its at least triggering?
darrell.ping.beinetworks
Newbie
Newbie
 
Posts: 21
Joined: Tue Mar 26, 2013 10:08 am

Re: Modifying Ignite Scripts Question

Postby mware.tabinc » Mon Apr 22, 2013 5:01 pm

Update the SVC - Auto Services Stopped Monitors and confirm the PC shows up on the "Query Results" tab. This monitor is set to run once an hour, so after stopping the service, you first have to wait for the inventory to update, (which it sounds like you did), and then wait for the Monitor to run within an hour give or take, and then wait for the script to trigger within a few minutes after that give or take.

You can try to force the monitor by right clicking and saying "Run Now". But I've had mixed results doing that.

-Mike
mware.tabinc
Full Member
Full Member
 
Posts: 141
Joined: Wed May 09, 2012 12:16 pm

Re: Modifying Ignite Scripts Question

Postby darrell.ping.beinetworks » Mon Apr 22, 2013 6:01 pm

I have "SVC - Auto Services Stopped" monitor in the 24x7 Workstation Service Plan set to my new script. If I open monitors and go to Internal Monitors and go to "SVC - Auto Services Stopped" It shows a status of Detected and when I double click it I see the services I stopped listed.

Im not sure if this is the cause of it not triggering but here in Internal Monitors under All Monitors all templates are set to Default - Do Nothing, but in 24x7 Work its set to enable with the alert template i created. Maybe i messed up the template. Ill look at it again..

Thanks again Mike for your continued help! Learning a lot as I work through this..
darrell.ping.beinetworks
Newbie
Newbie
 
Posts: 21
Joined: Tue Mar 26, 2013 10:08 am

Re: Modifying Ignite Scripts Question

Postby mware.tabinc » Tue Apr 23, 2013 10:23 am

That sounds right, all the internal monitors are set to the "Default - Do Nothing" template, and then have the "real" template to use applied at the group level. If you are still not getting your script triggered, I would suspect the template override you used at the group level doesn't have the "everyday" checked on.

If you go back and edit the template settings in the group and drill down to the screen where you actually selected the script to run. Just under the script is a block that sets which days and what time of day the script is allowed to run. By default none of the days are checked on. Just hit the "Everyday" check box to turn them all on.

(I can't tell you how many times I've missed this myself).
mware.tabinc
Full Member
Full Member
 
Posts: 141
Joined: Wed May 09, 2012 12:16 pm

Re: Modifying Ignite Scripts Question

Postby darrell.ping.beinetworks » Tue Apr 23, 2013 11:09 am

I did make that mistake :) I checked everyday yesterday but for some reason as of this morning it still hasnt run on my system. I see where it did run for one system though so im making progress.. maybe its because the issue was there before i checked everyday. I will clear everything and rerun the monitor maybe that will help.
darrell.ping.beinetworks
Newbie
Newbie
 
Posts: 21
Joined: Tue Mar 26, 2013 10:08 am

Re: Modifying Ignite Scripts Question

Postby darrell.ping.beinetworks » Tue Apr 23, 2013 11:23 am

Resetting the monitor and running it again did it! Perfect! Thank you SO much Mike! I think I have enough info now to start modifying the scripts to do what we want!
darrell.ping.beinetworks
Newbie
Newbie
 
Posts: 21
Joined: Tue Mar 26, 2013 10:08 am

Re: Modifying Ignite Scripts Question

Postby iwilson.avc » Wed Oct 02, 2013 10:16 pm

Hi Mike,
I read through this post and my understanding of scripting in Labtech has increased 100%. Thanks for taking the time to post this.
Iain
iwilson.avc
Newbie
Newbie
 
Posts: 2
Joined: Thu Jun 20, 2013 8:36 am


Return to 29B. Scripts

Who is online

Users browsing this forum: No registered users and 1 guest

cron