Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-25-2009, 08:02 AM   #1
LQ Newbie
Registered: Oct 2009
Posts: 22

Rep: Reputation: 0
[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?
Old 11-25-2009, 08:21 AM   #2
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
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).
Old 12-02-2009, 09:49 PM   #3
LQ Newbie
Registered: Oct 2009
Posts: 22

Original Poster
Rep: Reputation: 0
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!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to copy a file securly to remote host in JAVA waqasdaar Programming 1 02-03-2009 04:56 AM
How to backup image (file system) to remote Host. grens Linux - Enterprise 0 11-16-2007 01:54 PM
remote access file sharing ideas spanders Linux - Networking 5 12-22-2005 11:11 AM
Remote host did not accept control file (54) mudfrog Linux - Newbie 2 10-09-2004 06:33 PM
linux remote host monitor ehpserver Linux - Software 1 09-19-2003 04:28 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:55 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration