Skip to main content

developerworkslabel >  Tivoli  >  forumlabel  >  IBM Tivoli Monitoring (ITM) 6.1  >  developerWorks

Sending email alert on ITM    Point your RSS reader here for a feed of the latest messages in this thread


     

 
 

loginbox.header
 loginbox.welcomelabel loginbox.guestlabel
loginbox.signin
Permlink Replies: 33 - Pages: 3 [ 1 2 3 | Next ] - Last Post: Dec 2, 2009 12:05 AM Last Post By: DANPowers
Tivolinewbie

Posts: 75
Registered: Apr 14, 2008 12:06:32 AM
Sending email alert on ITM
Posted: Jul 07, 2008 04:04:56 AM
Click to report abuse...   Click to reply to this thread Reply
For sending email alert from ITM situation, I use script itmaction.pl

For example: On TEPS i create situation disk_space_low, and i want to send email to Administrator's mailbox if this situation is true.
. create situation NT_Disk_space_low
. in the take action set system command:

c:\itmaction2.pl lowdiskmb &{NT_Logical_Disk.Server_Name} &{NT_Logical_Disk.Disk_Name} &{NT_Logical_Disk.Free_Megabytes}

and my script:

$action=$ARGV[0]; #Action type - lowdiskmb
$hostName=$ARGV[1]; #ITM System name - &{NT_Logical_Disk.Server_Name}
$variable1=$ARGV[2]; #Depends on action - &{NT_Logical_Disk.Disk_Name}
$variable2=$ARGV[3]; #Depends on action - &{NT_Logical_Disk.Free_Megabytes}

if ($action eq "lowdiskmb") {
* system("c:\\windows
sendemail -f monitor\@domain.com -t Administrator\@domain.com -u Low Disk Space on $hostName -m Tivoli Monitoring reports the Disk $variable1 has only $variable2 Mb free on Server $hostName. This alert was triggered because this is less than 20% of the total space available. -s mail.domain.com");*

}

and in Administrator's mailbox, i received this email:

Subject: Low Disk Space on Primary:WIN2K3-ORI:NT
Tivoli Monitoring reports the Disk C: has only 36814 Mb free on Server Primary:WIN2K3-ORI:NT. This alert was triggered because this is less than 20% of the total space available.

Is so good. But when this situation running on some server so in Administrator's mailbox, i received alert email for only one server. Someone can help me fix this problem?

Message was edited by: Tivolinewbie

th@is4

Posts: 6
Registered: Jun 15, 2007 02:43:01 AM
Re: Sending email alert on ITM
Posted: Jul 07, 2008 08:06:16 AM   in response to: Tivolinewbie in response to: Tivolinewbiethread.responsepost
Click to report abuse...   Click to reply to this thread Reply
Hi.

Be sure that you are running the action on your TEMS (see action-tab in Situation Editor) instead on your agents. Otherwise you have to copy itmaction2.pl to every windowshost. Further you have configure sendmail and verify connectivity to your mailhost for every distribution target. With running the situation on your TEMS you only have to check, if the itmaction2.pl is placed on every TEMS in your Environment.
If you have multiple TEMS be sure you have copied itmaction2.pl to every TEMS, only HUB-TEMS will not be sufficient.

Kind regards,
Tobias.
Tivolinewbie

Posts: 75
Registered: Apr 14, 2008 12:06:32 AM
Re: Sending email alert on ITM
Posted: Jul 07, 2008 11:36:17 AM   in response to: th@is4 in response to: th@is4thread.responsepost
Click to report abuse...   Click to reply to this thread Reply
Can you please explain your idea. Because in the action-tab, i'd selected box "Execute the Action at the Managed System" so that my action had run on the target agent.Otherwise I'd configured sendmail and copied my script on TEMS and have only one TEMS in environment (managed object is some Unix/Window server).
Why do you have to copy itmaction2.pl to every windows host?
th@is4

Posts: 6
Registered: Jun 15, 2007 02:43:01 AM
Re: Sending email alert on ITM
Posted: Jul 08, 2008 02:51:53 AM   in response to: Tivolinewbie in response to: Tivolinewbiethread.responsepost
Click to report abuse...   Click to reply to this thread Reply
I don't suggest to copy the script to every agent. If you you choose to execute the action on the managed system you will have to copy the script to these agents. Because C:\itmaction2.pl then means C-Drive_of_your_agent:\itmaction2.pl. And if there's no script, the situation can not do anything.

Executing the situation-action on your TEMS does not mean the action itself will only be evaluated on your monitoring server. It only says the action (run c:\itmaction2.pl) will be performed on your monitoring server. So if you choose to execute the action on your TEMS you can distribute your situation to any agent but you don't have to copy the itmaction2.pl to these agents. In addition to that you only need to maintain one instance of your script.

Kind regards,
Tobias
Tivolinewbie

Posts: 75
Registered: Apr 14, 2008 12:06:32 AM
Re: Sending email alert on ITM
Posted: Jul 08, 2008 09:31:12 PM   in response to: th@is4 in response to: th@is4thread.responsepost
Click to report abuse...   Click to reply to this thread Reply
This is true. Thank you very much.
pethom

Posts: 28
Registered: Jan 11, 2006 04:29:10 AM
Re: Sending email alert on ITM
Posted: Jul 18, 2008 03:36:35 AM   in response to: Tivolinewbie in response to: Tivolinewbiethread.responsepost
Click to report abuse...   Click to reply to this thread Reply
Hi,

You can also go the following entry in this forum : Sending an email from ITM without using external product
I describe how to send a email without the need of any perl or any external products : I just use bat commands or shell scripts.

http://www-128.ibm.com/developerworks/forums/thread.jspa?threadID=213245&tstart=0

Regards.
SandyPro

Posts: 2
Registered: Jun 28, 2006 11:11:35 PM
Re: Sending email alert on ITM
Posted: Jul 22, 2008 01:37:42 PM   in response to: Tivolinewbie in response to: Tivolinewbiethread.responsepost
Click to report abuse...   Click to reply to this thread Reply
I am using ITM on a Windows box and use Blat to send emails. The link to download Blat is http://www.blat.net/. Install on the server and when you create/edit a situation, go to the action tab and under system command is where you would enter the string to set it up. This is how I have it setup on my server: Configure blat to run on your server. I created a .bat file that tells whatever uses blat to send emails to whoever I designate. Then in the system command box under Action, I put the path to the .bat file and then put the message I want to send to those recipients in quotes. Exxample: d:\scripts\notify.bat "There is an invalid logon on server {&NT_Event_Log.Server.Name}." As long as you use the server name in your attribute substition, you will get informed on what server the situation happened on.
Pervaiz

Posts: 58
Registered: Jan 29, 2008 12:17:54 AM
Re: Sending email alert on ITM
Posted: Dec 17, 2008 04:11:56 AM   in response to: SandyPro in response to: SandyProthread.responsepost
Click to report abuse...   Click to reply to this thread Reply
Is there any GUI Utility that gets integrated with ITM to send the email to the particular group of users on any situation?
Roseberry

Posts: 236
Registered: Jun 09, 2006 10:24:23 AM
Re: Sending email alert on ITM
Posted: Dec 17, 2008 05:13:49 AM   in response to: Pervaiz in response to: Pervaizthread.responsepost
Click to report abuse...   Click to reply to this thread Reply
No. ITM is a monitoring software. It has no built-in email features. The only gui interface to send email is to use the Action tab of the Situation Editor to enter a command line. On Unix/Linux the mail command can be used. On Windows one has to find something else (no buit-in mail software on Windows).

  • - - - - - -
Luc Roseberry
Roseberry International
http://www.roseberry-international.com
Pervaiz

Posts: 58
Registered: Jan 29, 2008 12:17:54 AM
Re: Sending email alert on ITM
Posted: Dec 17, 2008 07:31:44 AM   in response to: Tivolinewbie in response to: Tivolinewbiethread.responsepost
Click to report abuse...   Click to reply to this thread Reply
thanks for the post ...

Right now, I am using command line facility to send email to the specific users. But in near future I am going to deploy DB agents and Active Directory agents ... So it will be very difficult to manage those event ...

BTW, can we add multiple actions on same situations?

Rgds,
Pervaiz
Roseberry

Posts: 236
Registered: Jun 09, 2006 10:24:23 AM
Re: Sending email alert on ITM
Posted: Dec 17, 2008 07:56:34 AM   in response to: Pervaiz in response to: Pervaizthread.responsepost
Click to report abuse...   Click to reply to this thread Reply
Why would it be "very difficult" for DB or Active Directory agents? The situation editor has the same features.
To pass multiple command on linux use ; as in
ls / ; cp .toto /tmp
. One can also "pipe" from one command to another
ps -ef | grep -v toto

On Windows I think that command can be separated by &.

  • - - - - - -
Luc Roseberry
Roseberry International
http://www.roseberry-international.com
Pervaiz

Posts: 58
Registered: Jan 29, 2008 12:17:54 AM
Re: Sending email alert on ITM
Posted: Dec 18, 2008 01:11:46 AM   in response to: Roseberry in response to: Roseberrythread.responsepost
Click to report abuse...   Click to reply to this thread Reply
My TEMS in on Windows and I have used the Perl Scripting to email the alert to the users :::

I am passing this in the Action tab of the situation:

CustomizedAction.pl NTLogicalDiskSpaceCritical &{NT_Logical_Disk.Server_Name} &{NT_Logical_Disk.Disk_Name} &{NT_Logical_Disk.%_Used} &{NT_Logical_Disk.%_Free} &{NT_Logical_Disk.Timestamp} &{NT_Logical_Disk.Total_Size} &{NT_Logical_Disk.Free_Megabytes}

Now this CustomizedAction.pl is a script file on TEMS Server which contains Several functions, one of those function is NTLogicalDiskSpaceCritical which contains following code.

elsif ($action eq "NTLogicalDiskSpaceCritical") {
open (MT, ">c:\\windows\\NTLogicalDiskSpaceCritical$hostNameActual$variable2.txt");

print MT "Dear Application Administrator, \n\nIBM Tivoli Monitoring Reports a Windows Disk Space Critical on " , $ARGV[1],".";

print MT "\n\n Server Name: ", $ARGV[1];
print MT "\n Disk Name: ", $variable1;
print MT "\n Disk Used: ", $variable2,"%";
print MT "\n Disk Free: ", $variable3,"%";
print MT "\n Total Disk Size: ", $variable5, " MB or ", sprintf("%.2f",$variable5/1024) , " GB";
print MT "\n Remaining Space: ", $variable6, " MB or ", sprintf("%.2f",$variable6/1024) , " GB";
print MT "\n Time Stamp: ", $date,"/",$month,"/",$year," ",$hour,":",$minute,":",$second;

print MT "\n\nThis is a system generated email. Please donot reply directly to this email. \n\nFor further assistance, contact the IBM System Administrator at +92-21-2463308-10. \n\nIBM System Administration Team.";

close (MT);

# send the email using the mail template file
system("c:\\windows\\system32\\sendemail -f ITM.MONITORING\@ITM.COM -t $emails -cc windows.sysadmin\@hblpk.com -u ***ITM ALERT*** Windows Disk Space Critical on $ARGV[1] -o message-file=c:\\windows\\NTLogicalDiskSpaceCritical$hostNameActual$variable2.txt -s 192.168.0.53");
}

-----------------------------------------------*************************************--------------------------------------

Now if, I have to go for DB agents i.e: Oracle, DB2, SQL & for Active Directory then there will more than 300 situations on which I have to go for the action and to check the parameters.

Well, If there is no other way of sending email or there is no email engine that can connect with ITM then I have to proceed in this way :) no worries :) :) :)

Rgds,
Pervaiz

DANPowers

Posts: 6
Registered: Oct 22, 2006 04:35:50 AM
Re: Sending email alert on ITM
Posted: Mar 28, 2009 11:12:43 PM   in response to: Tivolinewbie in response to: Tivolinewbiethread.responsepost
Click to report abuse...   Click to reply to this thread Reply
There are a few VARIABLES that are available to no matter what situation fires:
&_SITNAME
&_SITTIME
&_SITNODE
&_PREDICATE --> the formula that fired the situation

The example I show (written in VB, but could be done in perl easy) is to always send the TAKE action command defined as:

cscript c:\email.vbs &_SITNAME &_SITTIME &_SITNODE "&_PREDICATE" &{INTERNETMANAGED_URL00.URL}

(The Last Variable is the only one that changes, and not every time)

So now I know the SITUATION Name and the Agent that the event happened on, as well as the TIME and Formula. Next, we create a NEW DB in the TEMS datbase, for example called ITM_LOOKUP. This table (currently) has the following fields

1. KEY - Our index we are going to use to determine what to do next
2. E-MAIL Address - The person or Group to send e-mail to
3. SCRIPT - The ability to call yet another script/action of course would execute on the TEMS serve
4. XML_TEMPLATE - Going to use this to pick which TEMPLATE to use when making the E-mail body

Now, in our VB script we do a few things

1. Create a connection to the ITM_LOOKUP DB/TABLE
2. Test to see if a few combinations of our data is in the table

DANPowers

Posts: 6
Registered: Oct 22, 2006 04:35:50 AM
Re: Sending email alert on ITM
Posted: Mar 28, 2009 11:28:52 PM   in response to: Tivolinewbie in response to: Tivolinewbiethread.responsepost
Click to report abuse...   Click to reply to this thread Reply
There are a few VARIABLES that are available to no matter what situation fires:
&_SITNAME
&_SITTIME
&_SITNODE
&_PREDICATE --> the formula that fired the situation

The example I show (written in VB, but could be done in perl easy) is to always send the TAKE action command defined as:

cscript c:\email.vbs &_SITNAME &_SITTIME &_SITNODE "&_PREDICATE" &{INTERNETMANAGED_URL00.URL}

(The Last Variable is the only one that changes, and not every time)

So now I know the SITUATION Name and the Agent that the event happened on, as well as the TIME and Formula. Next, we create a NEW DB in the TEMS datbase, for example called ITM_LOOKUP. This table (currently) has the following fields

1. KEY - Our index we are going to use to determine what to do next
2. E-MAIL Address - The person or Group to send e-mail to
3. SCRIPT - The ability to call yet another script/action of course would execute on the TEMS serve
4. XML_TEMPLATE - Going to use this to pick which TEMPLATE to use when making the E-mail body

Now, in our VB script we do a few things

1. Create a connection to the ITM_LOOKUP DB/TABLE
2. Test to see if a few combinations of our data is in the table
a. SITNAME:Hostname_Probe
b. SITNAME:Hostname
c. SITNAME
d. Hostname
e. Agent Type

We query the Table we created to find the most exact match possible, then work backwards from there, once we find a match in the Database table, we now know who to send the e-mail to, and if there is another script we would like to run.

Example:

suppose I have a situation Called NT_DISK_CRITICAL, and this triggers on Server Primary:SERVERX:NT for Logical Disk d:

When this data is passed to the Take Action VBS script, we know
SITUATION NAME = NT_DISK_CRITICAL (from the &_SITNAME)
Agent/Node = Primary:SERVERX:NT (from the &_Agent)
and the Probe/disk = D: (we passed that as the first Varibale subsituion for the event)

Now I query my table looking for

1. NT_DISK_CRITICAL:SERVERX_D: (yes we pull out the hostname only)
2. NT_DISK_CRITICAL:SERVERX
3. NT_DISK_CRITICAL
4. SERVERX
5: NT -- The agent type taken from AGENT
6. Default setting - (if nothing else matches)

and my Table in the DB might look like this:

NT_DISK_CRITICAL:SERVERBOB_C: WebGroup@mycomp.com None Web.xml
NT_DISK_CRITICAL:SERVERX_C: NTAdmin@mycomp.com None NT.xml
NT_DISK_CRITICAL:SERVERX_D: Me@Mycomp.com CleanLogs.sh NT.xml
NT_DISK_CRITICAL ntgroup@Mycomp.com None NT.XML

The match we would get would the 3rd line (which is really the 3rd entry in the DB table), becuase it matches my situation Name, Server And disk drive. now I know who to send the e-mail to, the xml which defines the template for the e-mail body and will also auto run the CleanLogs.sh script on the TEMS server.

Once you have this structure in place, all you have to do is update the DB Table with information to route e-mail notifications to various people/groups. This makes ITM work like a T/EC Fact file or Omnibus Lookup Table.

Working on actually making a WebPage in the TEPS to update/view this table.

Regards-

PS:

E-mail might look like this:

Subject: Tivoli CRITICAL Waring on SERVERX D:
Dear, Me@Mycomp.com

the Tivoli system has found an error on SERVERX for the NT_DISK_CRITICAL on D:
This happened on 02/30/09 10:13:24 by using the formula:

If %Space Used > 95 and Drive != _Total

Further Information:

Drive: D is of size 123,400MB and is at 96% Used

-Tivoli
(do not reply to message)
noti999

Posts: 2
Registered: Apr 10, 2009 01:57:17 PM
Re: Sending email alert on ITM
Posted: Apr 10, 2009 01:59:20 PM   in response to: Tivolinewbie in response to: Tivolinewbiethread.responsepost
Click to report abuse...   Click to reply to this thread Reply
can I share your itmaction.pl and other perl scripts.

Thanks

Javed

Point your RSS reader here for a feed of the latest messages in all forums