Ommaint fixes

General feedback

Moderators: ScalixSupport, admin

BaldBoy
Posts: 141
Joined: Fri May 19, 2006 12:45 pm

Ommaint fixes

Postby BaldBoy » Sat Jul 28, 2007 9:52 pm

Playing around with ommaint we've found we had to fix a couple of things.
Here are the diffs:
  • First of all check free space on any filesystem type (not only ext3)
  • Then there was a bug on checking port 25 for smtp service


Code: Select all

--- ommaint   2007-03-14 06:06:16.000000000 +0100
+++ ommaint.fixed   2007-07-29 03:48:09.000000000 +0200
@@ -98,24 +98,24 @@
    # ACTION: Check Disk Space Utilization
    #    Notify administrator if disk space utilization on any filesystem >= 80%
    #
-   df -t ext3 | awk '{if (int($5)>=80) {print $0}}' > $STDOUT
+   df -T | awk '{if (int($5)>=80) {print $0}}' > $STDOUT
    if [ -s $STDOUT ]
    then
       echo "These filesystems have >= 80% disk space utilization:" >> $MAINTLOG
       echo "--------------------------------------------------" >> $MAINTLOG
-      df -t ext3 | head -1 >> $MAINTLOG
+      df -T | head -1 >> $MAINTLOG
       cat $STDOUT >> $MAINTLOG
    fi
 
    # ACTION: Check Inode Utilization
    #    Notify administrator if inode utilization on any filesystem >= 80%
    #
-   df -i -t ext3 | awk '{if (int($5)>=80) {print $0}}' > $STDOUT
+   df -i -T | awk '{if (int($5)>=80) {print $0}}' > $STDOUT
    if [ -s $STDOUT ]
    then
       echo "These filesystems have >= 80% inode utilization:"   >> $MAINTLOG
       echo "--------------------------------------------------" >> $MAINTLOG
-      df -i -t ext3 | head -1 >> $MAINTLOG
+      df -i -T | head -1 >> $MAINTLOG
       cat $STDOUT >> $MAINTLOG
    fi
 
@@ -292,7 +292,7 @@
    #   Attempt to restart the offending port
    #
    echo "--Performing Port Check on localhost:25-----" >> $STDOUT
-   $PERLSCRIPT  25 >> $STDOUT
+   $PERLSCRIPT $($OMCK -h) 25 >> $STDOUT
 
    if [ $? -eq 1 ]
    then


Hope it helps.

BaldBoy
Posts: 141
Joined: Fri May 19, 2006 12:45 pm

Postby BaldBoy » Sat Jul 28, 2007 9:59 pm

From the code above you even have to replace

Code: Select all

int($5)

with

Code: Select all

int($6)

for each awk pipe.

jaime.pinto
Scalix Star
Scalix Star
Posts: 709
Joined: Fri Feb 23, 2007 6:50 pm
Location: Toronto - Canada

Postby jaime.pinto » Sun Jul 29, 2007 1:08 am

We probably could fix this script to set a "email already sent" flag, so that once disk usage has reached 80% and the email sent, it stops sending emails again every 30 minutes.
Image Jaime
||||||||||||||||||||||||||||||||||||||||

BaldBoy
Posts: 141
Joined: Fri May 19, 2006 12:45 pm

Postby BaldBoy » Thu Aug 02, 2007 5:15 am

Hmmm ... it would be interesting anyway I think it's better (at least for me) to have a continuos ringing bell alerting for critical conditions. Sometimes alerts get forgotten and the consequences may become a tragedy.

asd_itops
Posts: 82
Joined: Tue Feb 06, 2007 12:33 pm

Postby asd_itops » Thu Aug 30, 2007 3:48 pm

Can anyone point to the most current version of ommaint?

gren
Scalix
Scalix
Posts: 264
Joined: Thu Mar 25, 2004 10:27 am
Contact:

Postby gren » Fri Aug 31, 2007 5:22 am



Return to “Feedback”



Who is online

Users browsing this forum: No registered users and 1 guest