LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   shell script (https://www.linuxquestions.org/questions/linux-server-73/shell-script-817030/)

lamou23 06-29-2010 01:29 PM

shell script
 
hello,

have any one some shell scripts which allow me to manage services like:http,pop3,smtp... and display "ok" if it works good, warning if the execution of the service is slow, and critical if the service is stopped.

help please
thanks

TB0ne 06-29-2010 01:35 PM

Quote:

Originally Posted by lamou23 (Post 4018510)
hello,

have any one some shell scripts which allow me to manage services like:http,pop3,smtp... and display "ok" if it works good, warning if the execution of the service is slow, and critical if the service is stopped.

help please
thanks

We'll be glad to help you with scripts, but not going to write them for you. Post what you've written, and where you're stuck, and we can help. Otherwise, there are many bash scripting tutorials on the web.

Also, there are several process monitoring tools you can Google for.
http://www.yolinux.com/HOWTO/Process-Monitor-HOWTO.html

pixellany 06-29-2010 01:37 PM

lamou*;
This is starting to look like a series of homework questions....Please tell us more about what you are doing. For example, taking a class, following a tutorial, etc.

Also, please be sure to follow up in your previous threads---Including the one I just posted to a few minutes ago.

lamou23 06-29-2010 01:47 PM

shell script
 
hello

I have this script, but it doesn't give me all information about the bind9 service

*****************************
#!/bin/bash

RPORTS=$(netstat -tulpn | grep -vE '^Active|Proto' | grep 'LISTEN' | awk '{ print $4}' | cut -d: -f2 | sed '/^$/d' | sort -u)
for r in $RPORTS
do
if [ $r -eq 53 ]
then
echo "YES"
sendmail=1
exit 0

fi
done
echo "NO"



thanks


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