Thruk? - Nagios-Wiki
Thruk? - Nagios-Wiki
Thruk? - Nagios-Wiki
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Why another one?31.05.2010 www.consol.com55
Why another one?• Most alternatives are “Web 2.0” and nice to look at• None with Livestatus• Most alternatives cover only specific features• Most alternatives are written in PHP• Classic GUI is fine but• lacks some features for large environments• is too slow• never uptodate• cannot be clustered• limited to one backend instance31.05.2010 www.consol.com66
How it works today31.05.2010 www.consol.com77
How it works today?Web InterfaceLog File Status File Config FilesExternalCommand File<strong>Nagios</strong> Daemon31.05.2010 www.consol.com88
Architecture31.05.2010 www.consol.com99
Architecture<strong>Thruk</strong> Web InterfaceLivestatus Module(s)<strong>Nagios</strong>DaemonLog File31.05.2010 www.consol.com1010
Architecture• Catalyst Server• For testing / developmentonly• No authentication• No separate webserver<strong>Nagios</strong> CoreLivestatusNEB ModuleCatalyst Server<strong>Nagios</strong> Core<strong>Thruk</strong>LivestatusNEB Module31.05.2010 www.consol.com1111
Architecture• Apache with mod_fastcgi• Webserver and <strong>Thruk</strong>will operate independentlywith separate users• static content can beprovided by the Apache<strong>Nagios</strong> CoreLivestatusNEB ModuleApacheWebservermod_fastcgiCatalystFastCGI Server<strong>Nagios</strong> Core<strong>Thruk</strong>LivestatusNEB Module31.05.2010 www.consol.com1212
Architecture• Apache with mod_fcgid• Webserver and <strong>Thruk</strong>will operate with the sameuser• FastCGI process will bestarted on the first request<strong>Nagios</strong> CoreLivestatusNEB ModuleApacheWebservermod_fcgidCatalystFastCGIServer<strong>Nagios</strong> Core<strong>Thruk</strong>LivestatusNEB Module31.05.2010 www.consol.com1313
Architecture• Other possible scenarios• Failover Central <strong>Nagios</strong>• <strong>Nagios</strong> load balancing withDNX• Every Component coulduse a different hostApacheWebserver<strong>Thruk</strong><strong>Nagios</strong> CoreApacheWebserver<strong>Thruk</strong><strong>Nagios</strong> CoreLivestatusNEB ModuleLivestatusNEB ModuleDNX Client DNX Client DNX Client DNX Client31.05.2010 www.consol.com1414
Installation31.05.2010 www.consol.com1515
Installation• <strong>Thruk</strong> has many Perl module dependencies (~57 direct dependencies)• Installation from source with GIT & CPAN is easy but time consuming• Make use of Local::Lib• There are pre configured packages for Debian/Centos/OpenSuse and FreeBSD• make sure libgd and libxpm is installed%> PERL_ARCH=$(perl -e 'use Config; print $Config{archname}')%> wget http://www.thruk.org/files/<strong>Thruk</strong>-0.64-$PERL_ARCH.tar.gz%> tar zxf <strong>Thruk</strong>-0.64-$PERL_ARCH.tar.gz%> cd <strong>Thruk</strong>-0.64%> ./script/thruk_server.pl• Configure at least one <strong>Nagios</strong> Core with Livestatus31.05.2010 www.consol.com1616
Installation• Secure Livestatus• Livestatus grants full access to nagios• use Socat with SSL when possible• Remote host with <strong>Nagios</strong> and Livestatus:%> /usr/bin/socat \-L/tmp/liveststatus-socat.lock \openssl-listen:9999,reuseaddr,fork,cert=.../remote-livestatus.pem,cafile=.../thruk.crt,keepalive,nodelay \UNIX-CLIENT:/usr/local/nagios/var/live.sock,keepalive• <strong>Thruk</strong> host:%> /usr/bin/socat \-L/tmp/liveststatus-socat.lock \UNIX-LISTEN:.../remote.sock,fork,keepalive,mode=0660,group=thruk \openssl-connect:remote-host:9999,cert=.../thruk-host.pem,cafile=.../remote-livestatus.crt31.05.2010 www.consol.com1717
Installation• Secure Livestatus<strong>Nagios</strong> CoreUnixSocketTcp/ SSLUnixSocketApacheWebserverLivestatusNEB Modulesocatsocat<strong>Thruk</strong>31.05.2010 www.consol.com1818
Installation• Make sure you have enough memory• “When it comes to time-space tradeoffs, Perl nearly always prefers tothrow memory at a problem.” - perlfaq 3• PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND9636 thruk 20 0 273m 164m 2008 S 0 2.0 0:02.80 perl9644 thruk 20 0 272m 163m 2036 S 0 2.0 0:02.80 perl9945 thruk 20 0 269m 160m 1956 S 0 2.0 0:01.80 perl9965 thruk 20 0 168m 59m 1788 S 0 0.7 0:00.16 perl9966 thruk 20 0 269m 160m 1956 S 0 2.0 0:01.78 perl16050 thruk 20 0 167m 57m 1272 S 0 0.7 0:00.92 perl• Set “PROCS=x” in your script/thruk_fastcgi_server.sh• mod_fastcgi uses FCGI::ProcManager::MaxRequests• mod_fcgid has FcgidMaxRequestsPerProcess setting31.05.2010 www.consol.com1919
Installation• Authentication• done by the webserver• whatever the webserver supports mod_auth, mod_auth_ldap, mod_auth_mysql...• Authorization• done by <strong>Nagios</strong> & <strong>Thruk</strong>• cgi.cfg -> <strong>Thruk</strong>• contacts -> <strong>Nagios</strong>• Installation covered in detail: http://www.thruk.org/documentation.php#_installation31.05.2010 www.consol.com2020
Live Demonstration31.05.2010 www.consol.com2121
Live Demonstration31.05.2010 www.consol.com2222
Live Demonstration31.05.2010 www.consol.com2323
Live Demonstration31.05.2010 www.consol.com2424
Live Demonstration31.05.2010 www.consol.com2525
Live Demonstration31.05.2010 www.consol.com2626
Live Demonstration31.05.2010 www.consol.com2727
Live Demonstration31.05.2010 www.consol.com2828
Live Demonstration31.05.2010 www.consol.com2929
Live Demonstration31.05.2010 www.consol.com3030
Live Demonstration31.05.2010 www.consol.com3131
Live Demonstration31.05.2010 www.consol.com3232
Live Demonstration31.05.2010 www.consol.com3333
Configuration Hints31.05.2010 www.consol.com3434
Configuration Hints• use_strict_authorization• every contact will see only hosts / services which he is assigned too• delay_pages_after_backend_reload• use when you reload nagios very often and experience problems with pending services• command_disabled• completely disable a command• cmd_defaults• tired of setting the same checkbox every time?• datetime_format_today• Make pages more readable• log4perl.appender.ErrorLog.Threshold=INFO• log submitted commands31.05.2010 www.consol.com3535
Plugins31.05.2010 www.consol.com3636
Plugins• Directory Structure• |-- docs|-- lib| `-- <strong>Thruk</strong>| |-- Action| |-- Controller| |-- Utils| `-- View|-- logs|-- plugins| |-- plugins-available| | `-- statusmap| | |-- lib| | | `-- <strong>Thruk</strong>| | | `-- Controller| | |-- root| | |-- t| | `-- templates| `-- plugins-enabled| `-- statusmap -> ../plugins-available/statusmap|-- root| `-- thruk| |-- images| |-- javascript| |-- plugins| | `-- statusmap -> ../../../plugins/plugins-enabled/statusmap/root| `-- themes| |-- Classic| |-- Exfoliation|-- script|-- ssi|-- t`-- templates• Package Content• Symlink to enable Plugin• Auto generated31.05.2010 www.consol.com3737
Future Plans31.05.2010 www.consol.com3838
Future Plans• Some interesting planned features• Make side menu configurable• Make CGIs modular like statusmap• More filter: latency, execution_time• Backends based on contactgroups• _HTML custom variable• Webservice API• More plugins• Complete list: http://www.thruk.org/todo.php31.05.2010 www.consol.com3939
QUESTIONS?31.05.2010 www.consol.com4040
Thanks• http://labs.consol.de/lang/en/nagios/thruk/• http://www.thruk.org• http://github.com/sni/<strong>Thruk</strong>• sven@consol.de31.05.2010 www.consol.com4141