Action Scripts

Action scripts work in a similar manner to Target Scripts. They are also just a function that is executed with a number of parameters. The return value of the function should be a string and is only used for information as to what the script did, or if there was a problem, the problem details should be reported. During testing of the script with the 'Failure Action Manager', this value is returned and displayed on the screen. During normal operation this value is put into the logs.

Unlike the Targets Function the only parameter that can be specified by the user, is Extras. The rest of the parameters are filled in by Net-Probe, and they are obtained from the Target that changed status.

When being executed with the help of 'Remote-Probe.pl', like with the target function, additional lines are added to the bottom of the script. These lines execute the function and also help Remote-probe.pl identify when the script is complete. One of the settings in Remote-Script.pl is timeout. This value is in seconds and can be found at the top of Remote-Script.pl, if opened with a text editor. If the script remains active for longer than this period, the script is 'killed' (ended).

VB-Script

Function DoAction(Title,Host,TargetID,AlarmCondition,Extras,FailureCount)
	......
End Function

Perl Script

sub DoAction
{
	my($Title,$Host,$TargetID,$AlarmCondition,$Extras,$FailureCount)=@_;
	.....
}

Tags are also supported by Action Scripts. Once again the presence of tags make configuration of the Action using the Add Action Wizard simpler by adding descriptions to items. Only three Tags are supported for Action Scripts:

Table 22.3. Script Tags

DescA description of the purpose and/or function of the script. Often additional info is added here.
OSDescription of the OS that the script could be used on
ExtraA description of what is required in the Extra argument. If the last char is an * then the wizard will assume something is required and will not allow the user to continue unless something is filled in

Here is an example of the tags found in the SendEmail-win32.vbs action script:

'^Descr: Sends an email with the details of the state change
'^OS: win32
'^Extra: Email Addresses*

Copyright (c) Warren Flemmer 2006www.net-probe.com