VMware Cloud Community
beerorkid
Contributor
Contributor
Jump to solution

email allerts: possible to configure subject line to include server name?

I am helping with a departments ESX3 system and they are wondering if it is possible to have the server name appear in the subject line of a alert email message.

The alerts (alarms) are working fine, but over weekends and every now and then when the VM's CPU % gets high they will get bunches of emails and they have to open up each one to see what server it is.

Is there some variable that can be inserted somewhere to include the server name?

Reply
0 Kudos
1 Solution

Accepted Solutions
esiebert7625
Immortal
Immortal
Jump to solution

Yes but not easily, by default VC uses the name of the alert in the subject, this cannot be changed. What you can do if you really want to do this is create individual alerts for each VM that are named the same as the server, ie. 'ServerA CPU Usage'. It would be a pain to set this up if you have alot of VM's though. Hopefully in a future release they add variables to customize the message.

fyi...if you find this post helpful, please award points by clicking the Helpful/Correct buttons...thanks

View solution in original post

Reply
0 Kudos
4 Replies
esiebert7625
Immortal
Immortal
Jump to solution

Yes but not easily, by default VC uses the name of the alert in the subject, this cannot be changed. What you can do if you really want to do this is create individual alerts for each VM that are named the same as the server, ie. 'ServerA CPU Usage'. It would be a pain to set this up if you have alot of VM's though. Hopefully in a future release they add variables to customize the message.

fyi...if you find this post helpful, please award points by clicking the Helpful/Correct buttons...thanks

Reply
0 Kudos
beerorkid
Contributor
Contributor
Jump to solution

well I figure you know what you are talking about cuz I saw no option in the GUI to do that.

Oh well at least the alerts work. Thanks for your help.

Reply
0 Kudos
hharold
Enthusiast
Enthusiast
Jump to solution

We were facing the same issue here, but with 200+ VM's creating an alarm per VM would just be too much.

What i have done is created a script and using bmail.exe , a freeware smtp mailer. (http://www.beyondlogic.org/solutions/cmdlinemail/cmdlinemail.htm)

In the VC alarm setting, i let VC run my script with a parameter: \{eventDescription}

i parse this parameter to the bmail tool as subject / body and my SMTP mail subject becomes something like:

Alarm Virtual Machine CPU Usage on LAB-ACDA10 changed from Green to Red

Alarm Host CPU Usage on cse01.nsm.kadaster.nl changed from Yellow to Green[/b]

My Run Script line in VC:

""E:\Apps\VMware\VMware VirtualCenter 2.0\Mail\mail.cmd" "\{eventDescription}""[/i]

(All quotes are mandatory for the script to work)

My script:

PUSHD %0\..

SET TEXT=%1 %2 %3 %4 %5 %6 %7 %8 %9

bmail -s smtp-server-adress[/i] -t recipients-address[/i] -f from-address[/i] -a %TEXT% -b %TEXT%

ECHO %TEXT% >> mail.log

GOTO :EOF[/i]

Hope this can help anyone.

cheers,

Harold

esiebert7625
Immortal
Immortal
Jump to solution

Nice...thanks for sharing this.

Reply
0 Kudos