Current time: 07-13-2025, 01:41 AM Hello There, Guest! (LoginRegister)


Post Reply 
[How-to] Configure MONIT to monitorize your server
Author Message
tioan Offline
Junior Member
*

Posts: 22
Joined: Dec 2006
Reputation: 0
Post: #17
RE: [How-to] Configure MONIT to monitorize your server
And here some two little script which checks if an packages upgrade from apt is avaible or not

/etc/monit/monitrc
Code:
# aptupgrade_check
check file aptupgrade_check path /tmp/aptupgrade_check
   if failed checksum and
   expect the sum 9bef78b12cd45bf489e1fac427dcf3b6
   then alert
/etc/cron.daily/aptupgrade_check
Code:
#! /bin/sh
#
# cron script to check apt for packages upgrades
#
# Written by Mattheus Happe <mhappe@gmail.com>

export LANG=C

/usr/bin/apt-get update && /usr/bin/apt-get upgrade -s > /tmp/aptupgrade_check

/usr/local/sbin/aptupgrade_reset
Code:
#! /bin/sh
#
# script to check apt for packages upgrades
#
# Written by Mattheus Happe <mhappe@gmail.com>

export LANG=C

echo "Reading package lists...
Building dependency tree...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." > /tmp/aptupgrade_check

then type
Code:
chmod +x /etc/cron.daily/aptupgrade_check &&
chmod +x /etc/cron.daily/aptupgrade_check
After upgrade your packages run /usr/local/sbin/aptupgrade_reset

For the future i will try to change the monit message checksumme failed into " apt upgrade available"

I hope someone will use it^^
(This post was last modified: 06-27-2007 03:14 AM by tioan.)
06-27-2007 03:03 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [How-to] Configure MONIT to monitorize your server - tioan - 06-27-2007 03:03 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)