I am trying to get an AWS plug-in working (https://github.com/level23/nagios-cloudwatch-metrics)
I have installed awscli as the nagios user, and can run it on the command line (although had to edit the .bash_profile to add: export PATH=~/.local/bin:$PATH
I can run the nagios-cloudwatch-metrics from the command line with no issue, however when I try to run it from within nagios it can't seem to find the aws executable.
I'm presuming this is because nagios isn't loading the bash_profile - is there somewhere in a nagios config where I export PATH to get it to be able to find it?
Thanks
Nagios not loading bash_profile
Re: Nagios not loading bash_profile
You could edit he script ans put the full in the command and that should work as well for you.
Add the directory to the aws command to this line and see if it works.
Add the directory to the aws command to this line and see if it works.
Code: Select all
COMMAND="aws cloudwatch get-metric-statistics"Be sure to check out our Knowledgebase for helpful articles and solutions!
-
SteveBeauchemin
- Posts: 524
- Joined: Mon Oct 14, 2013 7:19 pm
Re: Nagios not loading bash_profile
make a symbolic link to the location.
Code: Select all
ln -s /real-location/aws /usr/local/bin/awsXI 5.7.3 / Core 4.4.6 / NagVis 1.9.8 / LiveStatus 1.5.0p11 / RRDCached 1.7.0 / Redis 3.2.8 /
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
-
dwhitfield
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Nagios not loading bash_profile
Thanks for the assist @SteveBeauchemin!
Re: Nagios not loading bash_profile
Thanks, changing the COMMAND in the script to the location works - I'll give the symbolic link a try tomorrow and let you know!
-
dwhitfield
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Nagios not loading bash_profile
Ok, great, we'll be here tomorrow!