10/20/2008 -- Nagzilla client/server
01/10/2009 -- Updated 
05/26/2009 -- Updated
05/27/2009 -- Updated
07/06/2009 -- Updated
07/26/2009 -- Updated

DISCLAIMER: This is provided AS-IS with no warranty expressed or implied. I nor the company are responsible for anything you do with it so don't expect us to be.

LICENSE: GPL v2. See LICENSE File

Overview:

   Nagzilla was designed to be a Jabber relay "bot" in that it sits quietly in a room until it gets a message to relay to either a chatroom or a person. The early work was based on several simple examples out on the internets but didn't quite meet our needs. Namely they would just keep logging into a room every time they had something to say. That forced us to make it a daemon. This also allows us to now get nagzilla alerts from various systems and event creators. Nagzillac (the client program") accepts any string input and makes into a Jabber message. This should work with Google Talk (as it's Jabber based) but 
 that's not been tested. The only platform this has been tested on is ejabberd running on Ubuntu. I have no doubts it SHOULD work on other Jabber/Linux/Perl platforms as well. 

Nagzilla provides some rudimentary security. You have to have your IP address defined in nagzillad.cfg to send messages but on a local LAN spoofing is trivial. You should still use your firewall wisely in this case and allow access only from those clients who should have it. 

Installation:

Nagzilla consists of two components nagzillad (the server) and nagzillac (the client). They do not have to live on the same machine at all but require the
 same perl modules be installed. 

Required Perl Modules:

    IO::Socket
    IO::Socket::INET
    Net::Jabber       (Ubuntu package: libnet-jabber-perl)
    Config::Simple    (Ubuntu package: libconfig-simple-perl)
    Data::Dumper      (Ubuntu Package: libdata-dumper-simple-perl) 
    Log::LogLite      (Ubuntu package: liblog-loglite-perl)
    Getopt::Long
    Pod::Usage

Nagzillad Installation

   mkdir /etc/nagzillad/
   cp nazillad.cfg and nagzillad-config.pl to /etc/nagzillad 
   cp nagzillad.pl to /usr/local/sbin (or wherever on your system you want it to live) 
   Edit nagzillad.cfg to suit your needs (file should be self-explanatory) 
   start nagzillad.pl with  & or add an init script (next version?)

Nagzillac Installation 

   mkdir /etc/nagzillac
   cp nagzillac.cfg and nagzillac-config.pl to /etc/nagzillac
   cp nagzillac.pl to /usr/local/bin (or wherever on your system you want it to live)
   Edit nagzillac.cfg to suit your needs



Make the magic happen:

nagzillac.pl "TYPE^TO^MESSAGE^COLOROFMESSAGE" 

TYPE: This can be either 'groupchat' or 'chat' -- groupchat == a chatroom and chat == an individual
TO: What room or person to send to (can be full JID or just a nick with defined jabberserver sent)
MESSAGE: Your message (which should avoid having ^ in it)
COLOROFMESSAGE: Useful for nagios messages, current colors are red, yellow and green -- completely optional

EXAMPLE: nagzillac.pl "groupchat^chatroom^Hi guys a server is down in some far away place^red"

Usage:
     Nagzillac connects to and sends messages to nagzillad which relays them to Jabber

Arguments:
     -t     Type: either groupchat or chat REQUIRED
     -r     Room: Either chatroom name or JID of an individual REQUIRED
     -m     Message: The messages you would like to send enclosed in quotes REQUIRED
     -c     Color: The color of your message (currently only red, yellow and green work) OPTIONAL
     -h     Prints this message

EXAMPLE: nagzillac2.pl -t groupchat -r chatroom -m "hello server is down" -c red


   That's it. Not a bad little hack if you have to monitor stuff and sit in IM all day (or a chat room).
