Hi Team,
Could you please help us with the below requirement.
Nagios alert needs to be setup for the following:
Time: 2:30 AM every Sunday
SFTP Address: xx.xx.xx.xx
SFTP file location: /PRD
FileName: xx_x__x.log
Event: If the file xx_x__x.log is not present in the location. OR the file size is 0 an alert need to be sent
file size
-
gselvakumar
- Posts: 96
- Joined: Wed Mar 02, 2016 4:52 am
file size
Last edited by gselvakumar on Tue Nov 15, 2016 12:46 am, edited 1 time in total.
Thanks & Regards,
Gomathyshankar Selvakumar
Gomathyshankar Selvakumar
Re: file size
All sorts of examples and combinations of checking for files/file sizes/patterns here:
http://sites.box293.com/nagios/guides/c ... es-folders
...find one that works for you and let us know if you have any questions on configuring the check.
http://sites.box293.com/nagios/guides/c ... es-folders
...find one that works for you and let us know if you have any questions on configuring the check.
Be sure to check out the Knowledgebase for helpful articles and solutions!
Re: file size
I modified a plugin on the exchange:
https://exchange.nagios.org/directory/P ... 29/details
That can do this. You will need to install a few Perl modules first to get it working:
In action:
https://exchange.nagios.org/directory/P ... 29/details
That can do this. You will need to install a few Perl modules first to get it working:
Code: Select all
cpan -i Net::SFTP::Foreign
cpan -i Net::FTPSSL
cpan -i IO::PtyCode: Select all
[root@localhost libexec]# ./check_sftp_size.pl --host 192.168.67.105 --user root --password welcome123 --dir /prd --file Product_Colorway_Data.log --sftp
WARNING: Got file Product_Colorway_Data.log but it was empty!
# I add some content to the file
[root@localhost libexec]# ./check_sftp_size.pl --host 192.168.67.105 --user root --password hunter2 --dir /prd --file Product_Colorway_Data.log --sftp
Connected to 192.168.67.105, logged in as root, chdir'ed to /prd, downloaded Product_Colorway_Data.logYou do not have the required permissions to view the files attached to this post.
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
-
gselvakumar
- Posts: 96
- Joined: Wed Mar 02, 2016 4:52 am
Re: file size
Thanks mcapra and bwallace.
But to how to check file xx_xx_xx.log is not present in the location or the file size is 0 exactly at 3.00 am every Sunday.Could please help me with this requirement also.
But to how to check file xx_xx_xx.log is not present in the location or the file size is 0 exactly at 3.00 am every Sunday.Could please help me with this requirement also.
Last edited by gselvakumar on Tue Nov 15, 2016 11:19 pm, edited 1 time in total.
Thanks & Regards,
Gomathyshankar Selvakumar
Gomathyshankar Selvakumar
Re: file size
You would need to define a check period, something like this, and then assign it to that service.
This would give it a 10 minute window to check the service. There isn't a way to tell it to check 'exactly' at 3:00 due to scheduling.
Code: Select all
define timeperiod{
timeperiod_name sun-3am
alias Sun 3am
sunday 02:55-03:05
}
Former Nagios Employee