-   Linux - Newbie (
-   -   [Nagios] Ideas of Transferring file from remote to monitor host (

fabbie 11-25-2009 08:02 AM

[Nagios] Ideas of Transferring file from remote to monitor host
Hi gurus,
I'm new to Linux, Nagios, scripting, and would require some ideas to perform certain task.

Notify Nagios admins the condition of remote host database server through email. Slow query Datalog will be attached in email as well.

This is what I tried to do to do.
From Nagios monitoring host, use NRPE to execute check_mysql script to check for long running processes at the remote host. If there are any long running processes, these processes will be logged into a txt file. And, then from the remote DB host, the text file will be sent to the Nagios monitoring host, and then attached to email to notify Nagios users.

The problem now is.. I cant seem to produce a solid plan to sent the txtfile over from the remote host to the Nagios monitoring host.

This is a plan i thought of initially. Please take a look at the steps.
1) Nagios monitor use NRPE to check any long running processes at mysql DB.
2) Then, if there's long running processes, the remote host will inform NAgios monitor, which changes the condition of the service to "critical".
3) Nagios monitor will trigger event handler to use scp to grab file from remote host, and send email to notify users.

I personally think that using scp will create a huge security flaw if i store the remote host password in a eventhandling script to access remote host (is that even possible?).

Does anyone have any better ideas how I can transfer files using NRPE or Nagios?

MensaWater 11-25-2009 08:21 AM

Your plan seems valid to me.

You don't have to store password anywhere to use scp (and shouldn't). Instead you should create an ssh trust from the Nagios user to a user that can read the log file on the remote host (e.g. the owner if no one else can read the log).

fabbie 12-02-2009 09:49 PM

Thanks jlightner.
Sorry it took me sometime to reply.
You opinion is indeed insightful. I never thought of performing a SSH trust.
I'll be sticking to the idea I suggested, and will use the SSH trust method as well.!

Thanks, buddY!

All times are GMT -5. The time now is 07:09 AM.