[racktables-users] Betr.: RackTables + Nagios + Bacula (was: How to handle virtual machines)

Hi Frank,

Thanks for sharing these scripts with us.
At my company we also use Nagios and HP OpenView ServiceDesk for our
main ITIL processes (incident/problem/change/project mangement, but als
our CMDB). In adition of hooking up Nagios I'm thinkering about a link
with our CMDB.
With tags I can assosiate the object with a location code,also
synchronising the serial numbers, and other usefull info can ben done.
Much work to do, but I believe it is feasible.

I'll give an update when there is more than just the idea :-)

Regards,
Joep van Ingen
Unix System administrator

>>> 
Van:    Frank Altpeter <frank-racktables@xxxxxxxxxxx>
Aan:    <racktables-users@xxxxxxxxxxxxx>
Datum   5-2-2009 18:46
Onderwerp:      [racktables-users] RackTables + Nagios + Bacula (was:
How to handle virtual machines)

Hi there,

Since there were some questions about how I combined RackTables with
nagios and bacula, here's a little bit from my efforts in doing this.
Needs to mention that it's customized to our internal structure and
cannot 
be taken over into another environment without prior modification :)


- check_back.pl
this is a little script, added as nagios service check, which checks
the
local nagios configuration for hosts and looks into the mysql table(s)
of
one or more systems (bacula and racktables in my case) if they match
any
nagios host. Any host found, that is not found in nagios config, is
reported, so the IT can see if new systems are recorded at racktables
DB
and configured to be backed up.

- check_bacula_clientstatus.pl
This is a nagios check that queries the bacula database for the last
backup made and gives warning and/or critical alarm if the backup is
over
due or failed. It sets a link in the description field which leads
directly to the report page of the bacula-webconsole (bweb).

- check_racktable.pl
This is my check to see if the monitored system is correctly entered
at
the racktables system. It checks the presence of the object, and
queries
the information of it, so it can show within nagios where the object
is
located (e.g. rack location, switch port, uplink switch name, power
connection, etc.). So, if a system goes red, you can directly see where
to
look if you need to go to the machine console. Of course it also
defines a
link in the description field to direcly jump to the corresponding
racktables asset entry.

- generate_configparts.pl
My first creation of auto-generating nagios configuration parts based
on
mysql database queries. This project is quite new and this is the
first
attempt, but more will follow since I find that interesting :)
This script can - based on an array of database configurations -
create
configuration parts for nagios which then can be used in
servicechecks.
It more or less just creates hostgroups with n members in it, based on
sql queries. My current implementation asks bacula for all configured
clients and puts them in a hostgroup backuphosts, which is used in the
servicechecks bacula_clientstatus and bacula_fd to ensure that all
bacula clients are monitored. So I can throw away the mail functions
on
bacula. The second array is fetching hosts (object names) from
racktables
db which have a custom field set. This field is named "Service" which
means these are hosts for which we are managing software updates. So,
when
I set the "Service" field for a specific host to "Premium Updates"
(which
is in sales speak "we cover software updates within 24 hours after
announcement), nagios will automatically put this host in a specific
check, which goes via nrpe to the host and queries the available
updates
(via zypper, portsnap, apt-get, etc.). This could of course easily
expanded to n queries to build a complex auto-generated nagios config
based on n custom fields from racktables db. Oh, and don't forget that
this needs a "cfg_dir=/etc/nagios/config" in nagios.cfg to work :)


Well, so far from me. Hope this helps someone :)
But, as always, no warranty - but it's not great magic... just a
little
perl scripting from an admin which does have automation as hobby :)


 
Le deagh dhùraghd,

        Frank Altpeter

-- 
FA-RIPE *** http://www.altpeter.de/ 
|   If you fall and break your legs, don't come running to me. -Samuel
|   Goldwyn


###################################################################

* * *   D I S C L A I M E R   * * *

###################################################################

De informatie in dit e-mailbericht is vertrouwelijk en uitsluitend bestemd voor 
de geadresseerde. Wanneer u dit bericht per abuis ontvangt, gelieve 
onmiddellijk contact op te nemen met de afzender per kerende e-mail. Wij 
verzoeken u dit e-mailbericht te vernietigen en de inhoud ervan aan niemand 
openbaar te maken. Afzender aanvaardt geen enkele aansprakelijkheid voor 
onjuiste, onvolledige dan wel ontijdige overbrenging van de inhoud van een 
verzonden e-mailbericht, noch voor door haar daarbij overgebrachte virussen.

The information contained in this e-mail is confidential and may be privileged. 
It may be read, copied and used only by the intended recipient. If you have 
received it in error, please contact the sender immediately by return e-mail. 
Please delete this e-mail and do not disclose its contents to any person. 
Sender does not accept any liability for any errors, omissions, delays of 
receipt or viruses in the contents of this message which arise as a result of 
e-mail transmission.

Other related posts: