Linux

Check Processes and Ports

Description:

A script that checks if processes and TCP ports are up. Tested on Redhat Enterprise Linux 3,4, Fedora 4,5,6, Solaris 6,7,8,9 and HP-UX 11.11,11.23

Current Version

Last Release Date

June 16, 2009

Compatible With


Project Files
Project Notes
Heavily based on check_linux_procs. A script that checks if processes and TCP ports are up. Tested on Redhat Enterprise Linux 3/4, Fedora 4, Solaris 6,7,8,9 and HP-UX 11.11, 11.23 Process checks are divided into two different levels, warning and critical. This way you may monitor less important processes and critical processes at the same time. The part that checks if ports are up uses netstat. It will mostly detect if an server application does not start up correctly, and thereby does not open up it's port. If you want to be sure ports are up and that the application is listening on it, use more specialized socket check scripts or check_tcp. Usage: Edit the check_system_pp script and add whatever processes and ports that you want to monitor. For example: ---snipp---- PROCLIST_RED="sshd crond klogd" PROCLIST_YELLOW="less_critical_process other_stuffd" PORTLIST="22 25" ---snipp---- Command line example for nrpe.cfg: commandcheck_system=/path/to/nrpe/libexec/check_system_pp FAQ: Q: I do not have Bash installed. What to do? A: Just use regular bourne shell (sh). Edit the first line in the script to the path of sh. For example: #!/usr/bin/sh
Reviews (1) Add a Review
Port check is bullshit
by guckyh, August 31, 2012

let's simple check for ssh-port 22 this is the part of code used - then it looks if there is at least ONE line netstat -an | grep LISTEN | grep 22 result: *.22 *.* 0 0 49152 0 LISTEN *.22 *.* 0 0 49152 0 LISTEN *.11221 *.* 0 0 49152 0 LISTEN *.11222 *.* 0 0 49152 0 LISTEN *.22 *.* 0 0 49152 0 LISTEN (you get any line containing "22" not only where the PORT is 22!!



Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
1 (1)
Favorites
0
Views
171,054