LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-30-2014, 02:51 PM   #1
Hopsahejsa
LQ Newbie
 
Registered: Aug 2014
Distribution: CentOS 7
Posts: 21

Rep: Reputation: 0
Monitoring solution + bash script


Hi,
I prepared bash script in order to check connection to server and I would like to find some Nagios-like monitoring solution without having to install any agent/collector on the server.
Do you have any experience with something like that?

Thanks...
 
Old 08-30-2014, 04:30 PM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
snmp would work, but you'd have to write your own fancy front-end.
 
Old 09-01-2014, 05:59 AM   #3
Hopsahejsa
LQ Newbie
 
Registered: Aug 2014
Distribution: CentOS 7
Posts: 21

Original Poster
Rep: Reputation: 0
I solved it like this (port version):

if
((nc localhost 22 </dev/null 2>&1 | grep -q SSH) && \
(nc localhost 25 </dev/null 2>&1 | grep -q fix) && \
(nc localhost 21 </dev/null 2>&1 | grep -q 220));
then
sudo echo "<p align="left"><font size="9">`date +%R`</font></b></p>" > /var/www/html/front.html
sudo echo '<p align="center"> <img src="/pix/ok.png" /></p>' >> /var/www/html/front.html
else
sudo echo '<p align="center"> <img src="/pix/ko.png" /></p>' >> /var/www/html/front.html
fi

It is a little "amateur" but it suits my needs
 
  


Reply



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
bash script for monitoring file update epomqo Programming 3 01-30-2012 02:16 PM
Bash script server HDD monitoring mele Programming 1 05-19-2009 07:03 AM
Port Monitoring bash script twantrd Programming 15 01-29-2009 12:59 AM
Bash script for monitoring changes in a directory tree librano Linux - Software 4 10-30-2008 07:36 PM
bash script, monitoring running PID? thebover Programming 4 08-26-2004 02:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:06 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration