FreeBSD port monitoring revised

Some time ago I wrote simple script to monitor installed ports on FreeBSD machine (original post https://nhw.pl/wp/2006/06/13/monitoring-freebsds-ports/). It works quite well and shows me what is happening on some machines which are manage not only by me. And leaves some trace after handy portupgrade -a command ;-))

But when many ports are upgraded at once output from this script becomes mess and it is hard to read what was added/removed and upgraded. Well it happens when change relates to two ports, neighbours in alphabetical sequence. Diff output with my modifiers becomes unacceptable. So I rewrote it and yes, it is now in Ruby.

Instructions:

  • download it (http://nhw.pl/download/changedports.rb)
  • edit and change following variables:
    • EMAIL – address which will be used as From: and To: fields
    • MAILHOST – SMTP server
    • TEMPDIR – in this directory scripts uses two files mylist and oldlist. There is risk of race condition when TEMPDIR is accessible for write to everyone (linking mylist to some essential resource could be nasty) so use other dir than default /tmp/ and don’t run this script as a root – it does need any special rights to operate
  • Add it to cron as low-privileged user

Join the Conversation

1 Comment

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.