[Xymon] html_mail1.2 is using simple hostname instead of FQDN in the link in the message
Becker Christian
christian.becker at rhein-zeitung.net
Wed May 9 16:29:18 CEST 2012
Hello out there,
Perhaps there's anybody else using alerts:html_mail1.2 which is available from http://xymonton.org/alerts:html_mail1.2
I've set it up and i've done some changes to the way it sends the subject and the body. All of this is working fine.
There's one thing that makes me wonder and I've tried a bit for me, but I'm concerned why I cannot get this to work.
The body of the eMails coming from the perl script contains a link to the affected host, for example:
http://XYMONHOST/xymon-cgi/bb-hostsvc.sh?HOST=testhost&SERVICE=http
But I need to have the link as follows:
http://XYMONHOST.FULL-QUALIFIED-DOMAIN/xymon-cgi/bb-hostsvc.sh?HOST=testhost&SERVICE=http
This is due to the fact that we do monitoring for different customers having their Xymon servers with different domain names.
For example, we have a Xymon server xymonA.domainA.org and another one called xymonB.domainB.org.
Therefore I need the fully qualified hostname in the link.
While reviewing the perl code of the script I recognized a section "Retrieve the data from the environment variables".
Within there I inserted a line
$BBSERVERHOSTNAME = $ENV{'BBSERVERHOSTNAME'} || "";
The syntax is the same as for the other variables. Then I changed the line containing the subject for the eMail to contain this variable instead of $BBSERVERWWWNAME.
As last step I changed the setting for the XYMONSERVERHOSTNAME (which is also set as BBSERVERHOSTNAME) in xymonserver.cfg.
After restarting the xymon services and the webserver I'm still getting eMails containing the link WITHOUT having the fully qualified hostname.
I'm NOT getting entries in /var/log/xymon/alert.log saying that the variable $BBSERVERHOSTNAME is uninitialized.
When commenting out the line
$BBSERVERHOSTNAME = $ENV{'BBSERVERHOSTNAME'} || "";
in the perl script, then I get this message.
For me this means, that I might have done the most things the right way; didn't i? Anybody out there having an idea?
Sorry if my english isn't at 100%....
CHRISTIAN BECKER
System Engineer
CSC
August-Horch-Strasse 28, 56070 Koblenz, Germany
________________________________
CSC * This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose * CSC Deutschland Services GmbH * Registered Office: Abraham-Lincoln-Park 1, 65189 Wiesbaden, Germany * Board of Directors: Gerhard Fercho (Chairman),Thomas Nebe, Peter Schmidt * Registered in Germany: HRB 7574, Wiesbaden
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20120509/5bd08a9f/attachment.html>
More information about the Xymon
mailing list