LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Gentoo Linux & Nagios (https://www.linuxquestions.org/questions/linux-newbie-8/gentoo-linux-and-nagios-4175431670/)

Maddyn 10-11-2012 08:47 AM

Gentoo Linux & Nagios
 
Hey fellow Linux users,

seeing as I feel a bit silly asking a question before introducing myself, I'll start with a small introduction.

I'm a 22 year old kid living in Berlin, and February this year I started an apprenticeship to become a (direct translation) information science technician specialising in systems integration. So easily put, Network and System administration. Started with IT just this year, loving it though.

So my question and project is to impress my boss and help out with Company back up problems. How it runs is that once a week a Backup is done over Windows 7 Backup. The Backup is then uploaded to a Fileserver which is run on Linux Gentoo.

I've gotten around to figuring out Gentoo pretty well, and can pull of one or tricks. Yet what I would like to do is, write a bash script which runs on the fileserver checking (maybe with find?) if a specific backup folder as been updated in the past 8 days. And if not it returns a warning or critical to the Nagios server notifying me about it.

So, i'm not asking for a script but maybe a little help to put me in the right direction. I have obv. already googled alot, yet no real help other then letting Nagios check on its Host server if specific files exist with a time stamp.

Thanks alot,

M.

acid_kewpie 10-11-2012 09:31 AM

Wow, that sounds really impressive a way to get started.

So is your motivation to achieve the end result, or to write a mostly arbitrary script file?

For the end result, there are a fair few scripts around for Nagios, e.g. http://exchange.nagios.org/directory...-Check/details Note that Nagios scripts will work locally or remotely, you just need to run them via another remote check script, e.g. check_ssh or check_nrpe (i really dislike nrpe though...)

For learning... well here's a bash script doign mostly what you're after - http://www.noah.org/wiki/Test_file_age and from the way you talk, I'd think that as long as you take the time to understand what's going on you'll be fine. This solution doesn't use find though, so if you do want to use find, which is also a very legit way to do it, you'd want to use the -mtime option and check the exit code of find after it's completed (echo $?) as one way to work out a success or failure.


All times are GMT -5. The time now is 04:09 PM.