LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices

Reply
 
Search this Thread
Old 11-25-2009, 09:02 AM   #1
fabbie
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.

Objective
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?
Thanks.
 
Old 11-25-2009, 09:21 AM   #2
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,024
Blog Entries: 5

Rep: Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789
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, 10:49 PM   #3
fabbie
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!
 
  


Reply


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 05:56 AM
How to backup image (file system) to remote Host. grens Linux - Enterprise 0 11-16-2007 02:54 PM
remote access file sharing ideas spanders Linux - Networking 5 12-22-2005 12:11 PM
Remote host did not accept control file (54) mudfrog Linux - Newbie 2 10-09-2004 07:33 PM
linux remote host monitor ehpserver Linux - Software 1 09-19-2003 05:28 PM


All times are GMT -5. The time now is 03:19 PM.

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