Macro values don't seem to be consistent
Claudio Kuenzler
ck at claudiokuenzler.com
Mon Jul 11 16:42:13 CEST 2011
Hello,
Since today I have almost the same problem as Jim.
The $HOSTALIAS$ macro works fine for all the checks, except one host alias
is wrong. I got aware of it today.
Same version as Jim's, 3.2.3, compiled from source as well.
Host config:
define host{
use linux-platform-demo ; Name of host
template to use
; This host
definition will inherit all variables that are defined
; in (or inherited
by) the linux-server host template definition.
host_name server14
alias SERVER14-RANDOMDEMO
address 192.168.0.14
}
However in the notification e-mail the alias appears like this:
*Subject: ** PROBLEM Service Alert: SERVER17-RANDPROD/Service Check is
CRITICAL ***
* ***** Nagios ******
* Notification Type: PROBLEM
Service: Service Check
Host: SERVER17-RANPROD
Address: 192.168.0.14
State: CRITICAL
Date/Time: Mon Jul 11 11:12:20 CEST 2011
Additional Info: *
*CRITICAL No connection to 192.168.0.20!*
Note that the IP address is correct. Only the Host (which uses $HOSTALIAS$
if I'm not mistaken) is wrong. As this is also used in the subject of the
mail, a great confusion happened here at work today ;-).
I checked all host definitions for wrong alias values, but did not find so.
Anyone got an idea?
Maybe this is related to the problem Jim found, too.
thx
ck
On Wed, Jun 8, 2011 at 8:16 PM, Jim McNamara <jim at packetalk.net> wrote:
> **
> Hello all. I'm seeing an unexpected behavior in my nagios installs, and I'd
> appreciate some insight as to what I did incorrectly.
>
> This is nagios version 3.2.3 compiled from source.
>
> I added the $HOSTALIAS$ macro to the emails nagios generates, as often
> information in the alias makes it clearer which device has the problem. The
> host email looks like this:
>
> # 'notify-host-by-email' command definition
> define command{
> command_name notify-host-by-email
> command_line /usr/bin/printf "%b" "***** Nagios
> *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nAbout:
> $HOSTALIAS$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo:
> $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mail -s "**
> $NOTIFICATIONTYPE$ $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
> }
>
> The same modifications were made to the notify-service-by-email as well.
>
> This works somewhat as intended, it does add an "About:" line, but the
> value for $HOSTALIAS$ is not consistent.
>
> In the /usr/local/nagios/etc/objects/localhost.cfg file the host is defined
> as:
>
> define host{
> use linux-server
> host_name localhost
> alias old gray box on the metal stand
> address 127.0.0.1
> hostgroups linux-servers
> }
>
> When I click on Host followed by localhost in the web interface for nagios,
> I get a page with this data at the top:
>
> Host old gray box on the metal stand (localhost)
> In addition, the line "old gray box on the metal stand" is listed as the
> alias for localhost in /usr/local/nagios/var/objects.cache:
>
> define host {
> host_name localhost
> alias old gray box on the metal stand
> address 127.0.0.1
> check_period 24x7
> check_command check-host-alive
>
> When I receive a host email about localhost, the About: line in the email
> which should to my understanding contain the value of $HOSTALIAS$, instead
> has "localhost" listed where the $HOSTALIAS$ (old grey box on the metal
> stand) is expected.
>
> Here is the text of a recent email:
>
> ***** Nagios *****
>
> Notification Type: RECOVERY
>
> Service: current load
> Host: localhost
> About: localhost
> Address: 127.0.0.1
> State: OK
>
> Date/Time: Wed Jun 8 13:41:01 EDT 2011
>
> Additional Info:
>
> OK - load average: 1.18, 2.55, 2.34
>
>
>
> I checked and multiple copies of nagios aren't running, so I'm guessing I
> did something incorrect with the macro?
>
> Interestingly, this is happening to about half of the hosts I'm receiving
> emails for. Sometimes the $HOSTALIAS$ is correct, and other times it seems
> $HOSTALIAS$ is incorrect.
>
>
>
>
> ------------------------------------------------------------------------------
> EditLive Enterprise is the world's most technically advanced content
> authoring tool. Experience the power of Track Changes, Inline Image
> Editing and ensure content is compliant with Accessibility Checking.
> http://p.sf.net/sfu/ephox-dev2dev
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when
> reporting any issue.
> ::: Messages without supporting info will risk being sent to /dev/null
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20110711/d7e956e5/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list