Hello,
I am currently having issues with a Nagios check related to Amazon S3 file checks. I am trying to set up checks on the buckets in S3 to check file dates and times, so if our Synology units fail to back up to S3 we will be notified. Currently our Synology units backup files to S3 buckets, but the file dates and sizes change daily so it is not as simple as constantly checking for one file being backed up. Synology will notify us if they fail to back up to S3, but recently we had an issue where Synology broke and not only failed to back up but failed to notify that the backups failed.
In our environment we run a similar check that checks for file ages and if the file age in a folder is greater then 48 hours we get alerts. I have found only a few plugins online which even mention AWS, and I am having issues setting them up. https://exchange.nagios.org/directory/P ... 29/details This plugin I have been trying to use, and it seems easy enough. After putting the script into the /usr/lib/nagios/plugins folder I try to execute the script and get this response:
Can't locate HariSekhonUtils.pm in @INC (you may need to install the HariSekhonUtils module) (@INC contains: ./lib /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at ./check_aws_s3_file.pl line 24.
BEGIN failed--compilation aborted at ./check_aws_s3_file.pl line 24.
I have tried to follow his instructions here: https://github.com/harisekhon/nagios-plugins. But I have not been able to figure this check out yet. Has anyone had any luck with setting checks up to monitor files in AWS S3?
Thanks
Nagios checks for AWS S3 file ages
-
- Posts: 20
- Joined: Thu Jul 20, 2017 2:48 pm
Nagios checks for AWS S3 file ages
Last edited by Anonymous on Wed Sep 27, 2017 11:16 am, edited 1 time in total.
Reason: Fixed exchange URL for plugin
Reason: Fixed exchange URL for plugin
Re: Nagios checks for AWS S3 file ages
Hey @brianbelden,
It looks like you don't have a Perl module installed OR can't locate it.
When you followed the instructions, how exactly did you do it?
Did you do something like this?
I did this exactly the same thing, but I didn't move the plugin from the nagios-plugins directory. I kept it the same and it works just fine for me.
It looks like you don't have a Perl module installed OR can't locate it.
When you followed the instructions, how exactly did you do it?
Did you do something like this?
Code: Select all
git clone https://github.com/harisekhon/nagios-plugins
cd nagios-plugins
make
make perl
make perl-libs
-
- Posts: 20
- Joined: Thu Jul 20, 2017 2:48 pm
Re: Nagios checks for AWS S3 file ages
So the plugin does seem to run when I run it from the /nagios-plugins/ folder from the git-clone. If I move the plugin to the /usr/lib/nagios/plugins/ folder where the rest of the plugins are it fails. When I create the check_aws.cfg file in /etc/nagios-plugins/config do I just need to tell it to look at /root/nagios-plugins/ and leave the check_aws_s3_file.pl there?
Thanks
Thanks
Re: Nagios checks for AWS S3 file ages
A good way to do this would be to create a new $USERx$ macro in your resource.cfg and set the path of your nagios-plugins to where ever you put it.
That way, instead of calling $USER1$, you would call $USER5$ or whichever macro you choose in order to call the location of those plugins.
These are just examples, I only did (--help) because I don't have an aws to test from.
NOTE: I am using $USER5$ to call from the nagios-plugins directory.
This is just a quick example, ultimately you would use the $ARG1$ to pass other arguments you want in the command_line.. but this is an example.
I hope this helps!
Code: Select all
# Sets $USER1$ to be the path to the plugins --> This is where nagios plugins live.
$USER1$=/usr/local/nagios/libexec
# Sets $USER5$ to the path of nagios-plugins --> This is where the other nagios-plugins live.
$USER5$=/tmp/nagios-plugins
These are just examples, I only did (--help) because I don't have an aws to test from.
Code: Select all
define service{
use local-service ; Name of service template to use
host_name localhost
service_description Check_aws_help
contacts nagiosadmin
check_command check_aws_s3_file.pl!--help
notifications_enabled 0
}
Code: Select all
# check_aws
define command{
command_name check_aws_s3_file.pl
command_line $USER5$/check_aws_s3_file.pl
}
I hope this helps!
-
- Posts: 20
- Joined: Thu Jul 20, 2017 2:48 pm
Re: Nagios checks for AWS S3 file ages
Where do I reference the $ARG1$ and $ARG2$. I have seen many commands with these arguments, but where do I assign the values for these arguments?
Thanks
Thanks
Re: Nagios checks for AWS S3 file ages
You would define them in your commands.cfg
Which would look like this.
OR another example is like this (which has the options put in already)
You can decide on what you like, even taking a look at how other commands in your commands.cfg will help.
Let us know how it goes.
Which would look like this.
Code: Select all
# check_aws
define command{
command_name check_aws_s3_file.pl
command_line $USER5$/check_aws_s3_file.pl $ARG1$
}
Code: Select all
# 'check_local_mrtgtraf' command definition
define command{
command_name check_local_mrtgtraf
command_line $USER1$/check_mrtgtraf -F $ARG1$ -a $ARG2$ -w $ARG3$ -c $ARG4$ -e $ARG5$
}
Let us know how it goes.