System administration

Full blown packages...
Cricket is flexible system for monitoring trends in time-series data. I wrote several modules which basically use ssh to acquire data from remote hosts with minimal or no installation on monitored host (apart from .ssh/authorized_keys setup). They include monitoring of:
  • maillog (using perl script on target) screenshot
  • iptraf logfile (using perl script on target) screenshot
  • bind9 stat file (using rndc stats on target) screenshot
  • disk space (using df on target) screenshot
  • NTP servers (using ntpq on local host) screenshot
  • HP OmniBack (using OmniBack command-line user agent on local host)
    There is much more comprehensive package called omni_gantt, however...
  • PostgreSQL monitor for monitoring transactions and disk access
  • WiFi statistics using hostap driver on Linux screenshot
There is also generate-overview.pl script with generates daily, weekly, monthly and yearly overview of all cricket graphs on one page. It can show or hide some of graphs (to produce cleaner page) and state of each graph (shown or hidden) will be saved using cookies.
-= Download whole tar-ball or examine ChangeLog, CVS or README [fm]
cricket-modules.tar.gz 22 Kb
Mon is tool used for monitoring service availability and triggering alerts. I wrote or modified several modules for it:
  • pgsql.monitor is a script which monitors PostgreSQL databases, local and remote (it tries to connect and checks if there are tables in database)
  • fping+args.monitor is fping monitor which also understands username[:password]@host/database format of hostgroup which pgsql.monitor uses, so you can fping your database servers first
  • sap.monitor which monitors SAP R/3 servers using sapinfo from RFCSDK
  • socksch.monitor modification of tcpch.monitor to use SOCKS server (so you can check HTTP and SMTP server through SOCKS server -- I use it to reach external side of my servers)
  • lwp-http.mon and anon_ftp.monitor are HTTP and FTP monitors which support returning success if any of servers are available, thus creating possibility for bounce testing using hosts on Internet.
  • tcpch.monitor is modified to include option -f which will enable monitoring of services which close connection really fast (like SAP lpr server)
Modules are nice, but I wanted to check status of my servers using WAP phone, so... Another useful feature would be for mon to send me SMS alerts. Here is module for that:
-= All modules available for mon or take a look at ChangeLog or CVS [fm]
mon-modules.tar.gz 27 Kb

omni_gantt -- Work in progress

omni_gantt is a package consisting of three scripts which use OmniBack command-line client under Linux:

Together those package provides powerful and easy to use web reporting for OmniBack, much better than built-in html output without any hyper-links (you should really wonder why they decided to output html without any links...).

This package, however, have some visual BUGS which I have to solve before releasing 0.0 version. Gantt chars tend to get too wide. It's actually a design decision. I opted to show any event with at least two pixels wide bar in chart. That enables you to see status of that backup (by just moving mouse over spot) or see details (by clicking on it). I think that narrower segments (or skipping some really short events) is not valid option. However, it produces quite strange graphs at some times.

But, it's useful for us in current form also, so I decided to release it early (after 10 months of usage). I would also like to see versions ported to other databases (but, why? PostgreSQL is great :-) and/or to other backup systems (preferably Open Source ones). I'm not quite sure that I will do any of this. But, it's here, under GPL license, so you could give it a try.

-= All modules available for omni_gantt or take a look at ChangeLog, CVS or screenshot
omni_gantt.tar.gz 10 Kb
-=> psinib - Perl Snapshot Is Not Incremental Backup is script for backup of Samba/CIFS shares to central disk space with snapshots and it has it's own page.

Smaller PERL scripts

You really should rename scripts below before using them! By default, files have _download as extension to prevent web server execution. However, you will want to remove that extension before using them (and chmod 755 to make them executable). All those projects have CVS repository which you can browse.
-= script which reads syslog maillog (from multiple servers running sendmail and/or postfix) and follows each message as it hops from server to server. Output is written on message-by-message basis.
This script is extremely useful if your messages from multiple mail servers arrive in syslog out of order or interleaved with messages from other servers.
maillog_flow.pl 3.0 Kb
-= Perl (!) script to produce index file for HouseSpider, an Java applet that adds indexing and search capability to your web site.
It's much easier to use than suggested appletviewer and you can customize it to remove some parts of your web page (e.g. navigation)
HouseSpider.pl 1008 bytes
-= Did you ever needed to re-create your primary DNS server from secondary DNS? Did you try to read secondary bind DNS zone? Well, this script will sort it for you by IP numbers (and separate each B-class network -- but that's configurable)
sort_bindzone.pl 1.7 Kb
-= Send different attachments and same message to bunch of people, needs MIME::Lite from CPAN
email_attachements.pl 2.6 Kb
-= Remove some messages (e.g. Love Letter virus) from multiple mboxes. Very fast, some assembly required; based on code by David Luyer.
fix_mbox.pl 1.9 Kb
-= Take a directory of inboxes (in mbox format) and re-mail them through sendmail to check for viruses, expand aliases/forwards etc, etc...
mbox2sendmail.pl 819 bytes
-= Create passwd and shadow file for Linux PAM from Digital Unix (a.k.a. OSF) /etc/passwd file (no support for C2!)
osf2pam.pl 2.1 Kb
-= Draws graphs (signal and transfer) of your wireless card. Uses RRDTOOL. It can also draw normal ethernet interfaces for comparison.
istatd.pl 5.8 Kb

Other smaller scripts and snippets

-=> Shell script which will create terminal GUI to apt-cache search with ability to install package. Nothing else, nothing more, but much faster than aptitude for this simple task.
-= This is semi-inteligent script which tries to make diff between two directories which can have slightly different files (e.g. with or without .in at end of filename) or different directory structure. It won't work well if you have files which have same name in more than one place in source directory!
diff_dirs 703 bytes