Add result of an app to Mail Action
Add result of an app to Mail Action
Hi,
i have a test element who check the cpu usage and it want to run an action if the usage are upper then 95 % but how i can recieve the running processes with a high cpu usage in mail ?
i have created a script who get all running processes with cpu usage. how i can run this and add this to the mail action alert ?
i have a test element who check the cpu usage and it want to run an action if the usage are upper then 95 % but how i can recieve the running processes with a high cpu usage in mail ?
i have created a script who get all running processes with cpu usage. how i can run this and add this to the mail action alert ?
You may execute specially prepared scripts using Active Script or Shell Script test methods
http://www.ks-soft.net/hostmon.eng/mfra ... htm#script
http://www.ks-soft.net/hostmon.eng/mfra ... m#chkShell
Your script should return "Bad" status and information about process (Reply field) when CPU Usage is over 95%
Regards
Alex
http://www.ks-soft.net/hostmon.eng/mfra ... htm#script
http://www.ks-soft.net/hostmon.eng/mfra ... m#chkShell
Your script should return "Bad" status and information about process (Reply field) when CPU Usage is over 95%
Regards
Alex
Hi,
the Test Event should only return the percent value but the alert action mail should contain the percent value AND a process list with cpu usage.
so i have wrote a script who display all infos. but how i can run the script and add the results into the mail.
i cant using the "attach file" function because this test event and alert actions running on diverence servers on the same time.
the Test Event should only return the percent value but the alert action mail should contain the percent value AND a process list with cpu usage.
so i have wrote a script who display all infos. but how i can run the script and add the results into the mail.
i cant using the "attach file" function because this test event and alert actions running on diverence servers on the same time.
If script returns just CPU Usage value, how HostMonitor can get information about process? Script may return to HostMonitor only 2 variables: Status and Reply. That's it.the Test Event should only return the percent value but the alert action mail should contain the percent value AND a process list with cpu usage.
Attached file? Yes, this can be solution if your script can create such file. If you setup several test items to run this script, its not a big problem. You may setup Shell Script test items to start your script, using different parameters so each test item will create unique result files. You may create designated alert profile for each of such tests...i cant using the "attach file" function because this test event and alert actions running on diverence servers on the same time
Regards
Alex
hm okay here my idea:
at first an action event run a vb script that create a textfile with all process infos and cpu usage.
after them hm should run the next action event that send a mail to admin and contain the textfile from the first step.
But how i can select or enter the order of this actions and how i can use a variable in this two actions for the filename ? and how i can create a third and last step, that delete the textfile ?
at first an action event run a vb script that create a textfile with all process infos and cpu usage.
after them hm should run the next action event that send a mail to admin and contain the textfile from the first step.
But how i can select or enter the order of this actions and how i can use a variable in this two actions for the filename ? and how i can create a third and last step, that delete the textfile ?
I thought your script acts like test (not action), it checks CPU and records information about process into file...at first an action event run a vb script that create a textfile with all process infos and cpu usage.
So you want setup HostMonitor to checks CPU Usage and then start your script when CPU Usage is over 95%?
May be you can simply use Dominant Process test method instead?
http://www.ks-soft.net/hostmon.eng/mfra ... topprocess
If you are using the same conditions to start both actions, HostMonitor will start actions in creation order. So, create HM Script action 1st, and add "Send e-mail" action after that. Use ExecuteProgram HMScript command to start your script and wait for results.But how i can select or enter the order of this actions
http://www.ks-soft.net/hostmon.eng/mfra ... #actScript
If you create separate alert profile for each of such CPU-Process tests, you don't need to use any variables.and how i can use a variable in this two actions for the filename
However its more convenient to use just one profile. You may use Comment field of the test item to store file name, than you may use %FCommentLine1% (%FCommentLine2% or %FCommentLine3%, etc) variable as parameter of the action.
http://www.ks-soft.net/hostmon.eng/mfra ... .htm#macro
Is this really necessary?and how i can create a third and last step, that delete the textfile
Regards
Alex
Hi,
no i'm using the Performance Test to get the cpu usage.
And when the cpu usage higher then 95% the alert event should run a vb-script that get all processes with cpu usage so i cant use the Dominant Process method because i need all processes.
so i want to use one test with 2 alert events.
the first should create the file and the 2. test should send an email with the textfile
no i'm using the Performance Test to get the cpu usage.
And when the cpu usage higher then 95% the alert event should run a vb-script that get all processes with cpu usage so i cant use the Dominant Process method because i need all processes.
so i want to use one test with 2 alert events.
the first should create the file and the 2. test should send an email with the textfile
Agent? Agent is necessary when you need to check remote system located in different network protected by firewall. In such case you will need agent for Performance Counter test as well.
Actually both test methods have exactly the same requirements: admin rights, RPC and Remote Registry service, no firewall should block ports above 1023, etc
Regards
Alex
Actually both test methods have exactly the same requirements: admin rights, RPC and Remote Registry service, no firewall should block ports above 1023, etc
Regards
Alex
In other wordsSo, create HM Script action 1st, and add "Send e-mail" action after that. Use ExecuteProgram HMScript command to start your script and wait for results.
http://www.ks-soft.net/hostmon.eng/mfra ... #actScript
- 1st action: Run HMScript
- 2nd action: "Send e-mail"
Regards
Alex