<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>User experience with Merlin first time install</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Arial">Andreas et. al.,</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Based on information from the Nordic Meet, it looks like Merlin and Ninja are going to be default Nagios components in the future, thus I thought I would offer 2 cents worth of documentation and testing of Merlin from a users perspective.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Environment:</FONT>
<BR><FONT SIZE=2 FACE="Arial">Nagios 3.0.6</FONT>
<BR><FONT SIZE=2 FACE="Arial">MySQL 5.0.45</FONT>
<BR><FONT SIZE=2 FACE="Arial">OS: RHEL 5.3 64-bit</FONT>
<BR><FONT SIZE=2 FACE="Arial">Merlin: 0.5</FONT>
<BR><FONT SIZE=2 FACE="Arial">Setup: Single Nagios installation with all components (Nagios core, CGI's, NagVis, PNP, Merlin, etc.) running on the same box, monitoring 577 hosts and 5290 services.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Download source:</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">I could not get git to work through our proxy, after messing with it for a while I opted for a web download (</FONT><A HREF="http://git.op5.org/git/?p=nagios/merlin.git;a=tree;hb=a0b54f3434b95e49a1ccdff1fefba3f1f52514e8"><U><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">http://git.op5.org/git/?p=nagios/merlin.git;a=tree;hb=a0b54f3434b95e49a1ccdff1fefba3f1f52514e8</FONT></U></A><FONT SIZE=2 FACE="Arial">) (click on snapshot link). Put the download somewhere on your Nagios server.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Rename downloaded source:</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">The git gzip file has a really ugly name (merlin-a0b54f3434b95e49a1ccdff1fefba3f1f52514e8.tar.gz) so I renamed it, this will also help me track what software I'm running when I look back at the source file later.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">mv merlin-a0b54f3434b95e49a1ccdff1fefba3f1f52514e8.tar.gz merlin-0.5.tar.gz</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Untar source:</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">tar zxvf merlin-0.5.tar.gz</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Enter directory created by tar command:</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">cd merlin</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Read README:</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Check for required software:</FONT>
<BR><FONT SIZE=2 FACE="Arial"> - libdbi-dbd-mysql</FONT>
<BR><FONT SIZE=2 FACE="Arial"> - libdbi-devel</FONT>
<BR><FONT SIZE=2 FACE="Arial"> - sed (4.0.9 or later)</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">I had a good version of sed installed but I had to load the libdbi stuff:</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">yum install libdbi-dbd-mysql</FONT>
<BR><FONT SIZE=2 FACE="Arial">yum install libdbi-devel</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Make backup copy of Nagios config (install script for Merlin updates the nagios.cfg):</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">cp -R /usr/local/nagios/etc /usr/local/nagios/etc.6.15.2009</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Create mysql user for the merlin module to use when connecting to the database</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">mysql -u root -e \</FONT>
<BR><FONT SIZE=2 FACE="Arial">CREATE USER merlin IDENTIFIED BY 'YourPasswordHere';</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Compile Merlin:</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">make</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">I got some warnings when I ran make, I don't know what they mean. I thought they might be related to my OS being 64 bit, but I don't know, I proceeded with my install Here they are though Note: my install crashed 10 minutes after starting it up, this may be related, I posted the crash info seperately:</FONT></P>
<P><FONT SIZE=2 FACE="Arial"> CC module.o</FONT>
<BR><FONT SIZE=2 FACE="Arial">module.c: In function âmrm_ipc_writeâ:</FONT>
<BR><FONT SIZE=2 FACE="Arial">module.c:146: warning: cast from pointer to integer of different size</FONT>
<BR><FONT SIZE=2 FACE="Arial">module.c: In function âsetup_host_hash_tablesâ:</FONT>
<BR><FONT SIZE=2 FACE="Arial">module.c:186: warning: cast from pointer to integer of different size</FONT>
<BR><FONT SIZE=2 FACE="Arial">module.c:194: warning: cast to pointer from integer of different size</FONT>
<BR><FONT SIZE=2 FACE="Arial"> CC hooks.o</FONT>
<BR><FONT SIZE=2 FACE="Arial"> CC control.o</FONT>
<BR><FONT SIZE=2 FACE="Arial">control.c: In function âcreate_host_listsâ:</FONT>
<BR><FONT SIZE=2 FACE="Arial">control.c:39: warning: cast from pointer to integer of different size</FONT>
<BR><FONT SIZE=2 FACE="Arial">control.c: In function âcreate_service_listsâ:</FONT>
<BR><FONT SIZE=2 FACE="Arial">control.c:57: warning: cast from pointer to integer of different size</FONT>
<BR><FONT SIZE=2 FACE="Arial"> CC hash.o</FONT>
<BR><FONT SIZE=2 FACE="Arial"> CC logging.o</FONT>
<BR><FONT SIZE=2 FACE="Arial"> CC config.o</FONT>
<BR><FONT SIZE=2 FACE="Arial"> CC ipc.o</FONT>
<BR><FONT SIZE=2 FACE="Arial"> CC shared.o</FONT>
<BR><FONT SIZE=2 FACE="Arial"> CC io.o</FONT>
<BR><FONT SIZE=2 FACE="Arial"> CC protocol.o</FONT>
<BR><FONT SIZE=2 FACE="Arial"> CC data.o</FONT>
<BR><FONT SIZE=2 FACE="Arial"> LINK merlin.so</FONT>
<BR><FONT SIZE=2 FACE="Arial"> CC status.o</FONT>
<BR><FONT SIZE=2 FACE="Arial"> CC daemonize.o</FONT>
<BR><FONT SIZE=2 FACE="Arial"> CC daemon.o</FONT>
<BR><FONT SIZE=2 FACE="Arial"> CC net.o</FONT>
<BR><FONT SIZE=2 FACE="Arial"> CC sql.o</FONT>
<BR><FONT SIZE=2 FACE="Arial"> CC db_updater.o</FONT>
<BR><FONT SIZE=2 FACE="Arial"> LINK merlind</FONT>
</P>
<BR>
<P><FONT SIZE=2 FACE="Arial">Run Merlin Installation script:</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">sh install-merlin.sh --dest-dir=/usr/local/nagios/merlin --nagios-cfg=/usr/local/nagios/etc/nagios.cfg --db-type=mysql --db-user=merlin --db-pass=YourPasswordHere --db-name=merlin</FONT></P>
<P><FONT SIZE=2 FACE="Arial">I got some errors on install:</FONT>
<BR><FONT SIZE=2 FACE="Arial">ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)</FONT>
<BR><FONT SIZE=2 FACE="Arial">ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)</FONT>
<BR><FONT SIZE=2 FACE="Arial">Creating database merlin</FONT>
<BR><FONT SIZE=2 FACE="Arial">mysqladmin: connect to server at 'localhost' failed</FONT>
<BR><FONT SIZE=2 FACE="Arial">error: 'Access denied for user 'root'@'localhost' (using password: NO)'</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)</FONT>
<BR><FONT SIZE=2 FACE="Arial">Failed to setup database.</FONT>
<BR><FONT SIZE=2 FACE="Arial">Aborting.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">The script expects your mysql database to allow the user root@localhost to login without a password. We have a password for that user in our setup. I messed with the install script a bit to get around it but don't know enough to know how to do this right. So instead, I temporarily removed the password for this user on my system and reran the install script. It worked after that.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">The Merlin install script modifies your Nagios configuration files (specifically the main one nagios.cfg). You need to check the Nagios config before restarting Nagios:</FONT></P>
<P><FONT SIZE=2 FACE="Arial">/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg </FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">If the config verifies okay then restart Nagios:</FONT>
<BR><FONT SIZE=2 FACE="Arial">service nagios restart</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Running configuration check...done.</FONT>
<BR><FONT SIZE=2 FACE="Arial">Stopping nagios: .done.</FONT>
<BR><FONT SIZE=2 FACE="Arial">Starting nagios:Logging to '/usr/local/nagios/merlin/logs/neb.log'</FONT>
<BR><FONT SIZE=2 FACE="Arial">[1245098202] 6: Merlin Module Loaded</FONT>
<BR><FONT SIZE=2 FACE="Arial">[1245098202] 6: Coredumps in /tmp</FONT>
<BR><FONT SIZE=2 FACE="Arial"> done.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">It appeared to restart okay, though the last line 'Coredumps in /tmp' made me a bit nervous.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Start Merlin Daemon:</FONT>
<BR><FONT SIZE=2 FACE="Arial">service merlind start</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">I think that's it, it should be up and running. The Merlin module logs events to /usr/local/nagios/merlin/logs/neb.log, and the daemon logs events to /usr/local/nagios/merlin/logs/daemon.log.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Andreas, please review these steps for accuracy, I'm working only from the README and guessing the rest. Hopefully this is usefull to others.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Regards, </FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">-greg</FONT>
</P>
<BR>
</BODY>
</HTML>