Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable_environment_macros=1 doesn't seem to be working on 4.0.8 #124

Closed
brianjmurrell opened this issue Apr 26, 2016 · 1 comment
Closed

Comments

@brianjmurrell
Copy link

Exactly as reported in http://tracker.nagios.org/view.php?id=498 setting enable_environment_macros=1 doesn't seem to be resulting in macros being set as environment variables as pnp4nagios' synchronous mode wants.

To test I configured the following:

# 'process-service-perfdata' command definition
define command{
        command_name    process-service-perfdata 
        #command_line   /usr/bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n" >> /var/log/nagios/service-perfdata.out
        #command_line   /usr/bin/perl /usr/libexec/pnp4nagios/process_perfdata.pl
        command_line    /bin/bash -c /tmp/environ.sh
        }

where /tmp/environ.sh is:

#!/bin/bash

set >/tmp/environ.debug
exit 2

And when that fires /tmp/environ.debug contains:

BASH=/bin/bash
BASHOPTS=cmdhist:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath
BASH_ALIASES=()
BASH_ARGC=()
BASH_ARGV=()
BASH_CMDS=()
BASH_LINENO=([0]="0")
BASH_SOURCE=([0]="/tmp/environ.sh")
BASH_VERSINFO=([0]="4" [1]="2" [2]="46" [3]="1" [4]="release" [5]="x86_64-redhat-linux-gnu")
BASH_VERSION='4.2.46(1)-release'
DIRSTACK=()
EUID=980
GROUPS=()
HOME=/var/spool/nagios
HOSTNAME=server.interlinx.bc.ca
HOSTTYPE=x86_64
IFS=$' \t\n'
LANG=en_CA.UTF-8
LOGNAME=nagios
MACHTYPE=x86_64-redhat-linux-gnu
OPTERR=1
OPTIND=1
OSTYPE=linux-gnu
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
PPID=31441
PS4='+ '
PWD=/tmp
SHELL=/sbin/nologin
SHELLOPTS=braceexpand:hashall:interactive-comments
SHLVL=2
TERM=dumb
UID=980
USER=nagios
_=/tmp/environ.sh

I'm assuming there is supposed to be a whole lot more in that environment.

I do have use_large_installation_tweaks=0 so that should not be cancelling out the enable_environment_macros=1.

@jfrickson
Copy link
Contributor

I just tested it here with v4.2.1 and got 189 NAGIOS_* variables. Please upgrade to 4.2.1 and test it again. If it's still a problem, please reopen this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants