• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 827
  • Last Modified:

how to monitor an AIX supsystem using Web-Based System Manager ?

Hi all,

I need to monitor an AIX supsystem called qdaemon to send me an email when it is down using Web-Based System Manager.
Using Web-based System Manager, i can create a new condition for a filesystem like /var or /tmp
but i dont know how to create a new condition to monitor qdaemon and send me an email when it is down.
see the attached file below,
what "resource class" and "monitored property" do i need to select ?
anyway, do you have another way to monitor qdaemon status ?
i know when it is down, no one can print.
thanks




qdaemon-status.bmp
1
gsawan
Asked:
gsawan
  • 6
  • 5
1 Solution
 
woolmilkporcCommented:
Hi,
under 'Resource class' use 'Program', under 'Property' it's 'Processes'.
Under 'Monitored Resources'  enter as a selection string 'ProgramName=="qdaemon".

Under 'General' - 'Responses to condition' select your response (if you didn't create one see below, click OK anyway)
Creating a response
Go to 'Overview and Tasks' -> Create a new response.
Enter a name, then click 'add' .

 Under 'General' enter email address and options, under 'when in effect' click add, mark 'all day', 'Everyday' or whatever you want, then click 'set' and then OK.
 
If needed, go back to your condition and add your response - Under 'responses to condition' select your response from above (use the '<' arrow to add)
 
At last go to 'Overview ...' -> 'Monitor conditions' and verify that your new condition gets monitored. If not, select it on the right, click '< Start' and 'close'
Lokk at my next post!
 
wmp
 
0
 
woolmilkporcCommented:
... websm is not _that_ good monitoring tool!
I'd really suggest using nagios ->
 
www.nagios.org
 
wmp
 
0
 
gsawanAuthor Commented:
Hi guys,
i set it up as wmp's guide.
I will test it this afternoon and let you know.
thanks


0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
gsawanAuthor Commented:
Hi

pls see the 2nd and 3rd attached files below:

photo2.JPG
photo3.JPG
0
 
gsawanAuthor Commented:
pls have a look at those photo2 and photo3 above,

if i want to monitor the qdaemon, when it down, it will send me an email (already setup :"response to condition" the email address...)
what do i need to type in :"Event Expression" and Rearm expression" ?

if i leave it as what you see on the Photo2, what i receive is this one :
and it means nothing to me. I just want to receive email when it is down or crashed.

=====================================

Friday 11/14/08 11:15:02

Condition Name: qdaemonmonitor
Severity: Informational
Event Type: Event
Expression: Processes.CurPidCount != Processes.PrevPidCount

Resource Name: ProgramName == 'qdaemon'
Resource Class: IBM.Program
Data Type: CT_SD_PTR
Data Value: [2,1,{585908,1122310},{1122310}]
Node Name: server1
Node NameList: {server1}
Resource Type: 0
=====================================

0
 
woolmilkporcCommented:

Well,
unfortunately this is not that straightforward. Let's see!

1. If you only want to test whether qdaemon is running or not, please use under
'Condition -> General -> Event expression' only
ProcessesCurPidCount == 0
That will be enough. Your rearm expression is OK, as well as the selection string for monitored resources.

2. If we use the mail interface of websm, there is no possibility to change subject/body of the resulting mail.
So we will have to go another way. We will not use the builtin email function, but use an own script which will
exploit some environment variables we set for it and then send email.

So please go to the response you created and do the following:
- Mark under 'Action name' your created action -> Modify.
 Change the Action name to someting with suffix '_down'.
 Under Command to run select 'Run program' instead of 'Send mail',
 Under 'Enter program name' fill in the name of the script we will write, e.g.  
'/usr/local/scripts/event_mail'
- Check 'Run command when event occurs' _only_!
- Under the 'Environment' tab click 'Add',
 then define a first variable, RESOURCE, value 'qdaemon'.
 Repeat this by adding RECIPIENT, value 'your.email@address' and STATUS, value 'down'. Click OK
- In the 'Response' window, create a new Action by clicking 'Add'.
 Enter an Action name as something with suffix '_rearm'.
 Under Command to run select 'Run program'.
  Under 'Enter program name' fill in the name of the script above.
- Check 'Run command when rearm event occurs' _only_!
- Under the 'Environment' tab click 'Add',
 then define again a first variable, RESOURCE, value 'qdaemon'.
 Repeat this again by adding RECIPIENT, value 'your.email@address' and STATUS, value 'rearm'. Click OK
- Now, in the 'Response' window you should see two actions: one with suffix _down', one with suffix '_rearm'
 Click OK

3. Select 'Monitoring' in the left frame, in the right frame select 'Monitor conditions'. Verify that your
Condition still appears in the left window. If not, select it in the right window, then click ' < Start' and then
'Close'.

4. Put the script I appended in the right place on your machine, e.g. '/usr/local/scripts/event_mail'
Make it executable (chmod +x ...)
You can, of course, modify this script as you like, perhaps even by using more variables you defined like the
above.
Instead of echoing my poor string into the mail program, you could also feed a text file into it, by leaving out
the 'echo ...' up to the pipe '|' and adding '< [text_file_name'] at the end. You could also modify the text file
name using some of the variables, e.g. '> my_${RESOURCE}_${STATUS}_text_file', to make the script as flexible as
possible. Sure you must create the text file, e.g. 'my_qdaemon_down_text_file'

That's an interesting case we have her, so please test it and let me know what you think about my solution!

Good Luck!
Norbert (wmp)

#!/bin/ksh
echo "${RESOURCE} alert (${STATUS}) sent to ${RECIPIENT}" | mail -s "{$RESOURCE} ${STATUS}" ${RECIPIENT}
exit

Open in new window

0
 
woolmilkporcCommented:
... change the '>' before 'my_${RESOURCE}_${STATUS}_text_file' to '<'!
0
 
woolmilkporcCommented:
... and if we already use a script instead of pure email, how about adding 'startsrc -s qdaemon' to it after testing the content of $STATUS to be 'down'?
Just a hint ...
0
 
gsawanAuthor Commented:
Hi Norbert,

thanks alot for your information, i will need to test and get back to you as soon as i can.
cheers!
0
 
woolmilkporcCommented:
<<ping>>
 
0
 
gsawanAuthor Commented:
Hi Norbert,

Thanks alot for your help. I am still trying to get it to work based on your guide, i will get back here to update you soon.
thanks alot!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now