Sequence of actions in an action profile

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
thomasschmeidl
Posts: 166
Joined: Sat Apr 15, 2006 2:14 pm
Location: Germany, Bavaria

Sequence of actions in an action profile

Post by thomasschmeidl »

Hi,

we do a lot of tests 24*7 which trigger an SMS to the admin in case of a bad result. Most SMS actions are scheduled 16*7 (from 6 a.m. to 10 p.m.) so that we have to deal with how to delay action in case of test failure during the night (topic similar to http://www.ks-soft.net/cgi-bin/phpBB/vi ... php?t=2974)

Our solution uses three actions in the action profile
1. (24*7) HMS-Script writes comment to commentline#9 if (('%Simple Status%'=='%DOWN') and (%Recurrences%==3 '))
2. (16*7) SMS is triggered if (('%Simple Status%'=='%DOWN') and ('%CommentLine%'>' '))
3. (16*7) HMS-script clears commentline#9

This seems to work but it obviously depends on the sequence in which the actions are performed (expression 2 must be evaluated before action 3 is performed). After some tests we suppose that the actions are performed in the same sequence as they were put in the list (which is not the sequence in which they are displayed in the list). I couldn't find anything in the manual about that topic.

Q1: In which sequence will the expressions and schedules for actions in an action list be evaluated?
Q2: In which sequence will the actions be performed?
Q3: Does action 2 always wait until action 1 is completely finished.
Q4: Is there a kind of an internal action ID and can I retrieve it?

Regards

Thomas
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Q1: In which sequence will the expressions and schedules for actions in an action list be evaluated?
Q2: In which sequence will the actions be performed?
HostMonitor checks alert conditions and executes actions (if both conditions return True) in creation order. So, if action1 was created (by operator) before action2, then action1 will be executed before action2.
Actually actions displayed on the screen in the same order.
Q3: Does action 2 always wait until action 1 is completely finished

Depends on action. E.g. when HostMonitor executes "Generate reports", "Record HM log", "Log event", "SQL Query", "Run HM Script" actions, it waits for result before starting another action. While "Execute external program", "Send e-mail", "Send message to ICQ", "Send message to Jabber", "Send message to pager/beeper", "Stop/Start/Restart service", "Send SMS" actions can be executed at the same time.
Q4: Is there a kind of an internal action ID and can I retrieve it?

You cannot get that ID. Event if you can, how you will use it?

Regards
Alex
thomasschmeidl
Posts: 166
Joined: Sat Apr 15, 2006 2:14 pm
Location: Germany, Bavaria

Post by thomasschmeidl »

Hi Alex and thanx for the info,
Alex wrote:Actually actions displayed on the screen in the same order.
IMHO the actions are displayed in this order:
1. type of condition (standard, advanced, schedule)
2. in case of standard mode: Number of recurrences
3. Action Name
Alex wrote:You cannot get that ID. Event if you can, how you will use it?
As the ID represents the execution order and the display on the screen doesn't
Alex wrote:Quote:
Q3: Does action 2 always wait until action 1 is completely finished

Depends on action.
What about HTTP Request? We use it for the SMS!

Regards

Thomas
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

1. type of condition (standard, advanced, schedule)
2. in case of standard mode: Number of recurrences
3. Action Name
Yes, standard actions sorted by "Start when" parameter, then by name
As the ID represents the execution order and the display on the screen doesn't
1) ID does not have anything to do with execution order.
2) Its impossible (in general case) to predict execution order for advanced actions
What about HTTP Request? We use it for the SMS!
HTTP request processed asynchroniously

Regards
Alex
Post Reply