nagios conference 2012 - dave williams - embedding nagios using raspberypi

37
1 © Bull, 2012 26 th September 2012 Dave Williams Lead Technical Architect Embedding Nagios in the Raspberry Pi

Upload: nagios

Post on 13-May-2015

3.734 views

Category:

Technology


0 download

DESCRIPTION

Dave Williams' presentation on embedding Nagios on a RaspberyPi The presentation was given during the Nagios World Conference North America held Sept 25-28th, 2012 in Saint Paul, MN. For more information on the conference (including photos and videos), visit: http://go.nagios.com/nwcna

TRANSCRIPT

Page 1: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

1© Bull, 2012

26th September 2012 Dave Williams

Lead Technical Architect

Embedding Nagios in the Raspberry Pi

Page 2: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

2© Bull, 2012

Agenda

Page 3: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

3© Bull, 2012

Agenda

BackgroundThe Raspberry PiThe Raspberry Pi Nagios RecipeUsing DNX on the Raspberry PiDemonstrationFutures & ‘Blue Sky thinking’Conclusion

Page 4: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

4© Bull, 2012

Background

UK basedMainframe (IBM & Honeywell)Unix (HP-UX, AIX, Solaris)Network (CASE, 3COM, CISCO)

Working for BullFrench Computer ManufacturerMainframes, Unix, HPC, Security, Managed Services

Page 5: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

5© Bull, 2012

Background

System MonitoringOpenViewNetviewOpen Master

Open Source MonitoringNetSaint on AIXNagios

Page 6: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

6© Bull, 2012

The Raspberry Pi

Eben Upton and his colleagues at the University of Cambridge’s Computer Laboratory, became concerned about the year-on-year decline in the numbers and skills levels of the A Level students applying to read Computer Science in each academic yearThe Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video.

Page 7: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

7© Bull, 2012

The Raspberry Pi

Page 8: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

8© Bull, 2012

The Raspberry Pi

Raspberry Pi’s are nearly everywhere

http://rastrack.co.uk

Page 9: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

9© Bull, 2012

The Raspberry Pi

The demo / sample system is running Debian – Squeeze

Soon to be updated to Wheezy

Page 10: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

10© Bull, 2012

The Raspberry Pi Nagios Recipe

See http://exchange.nagios.org/directory/Documentation/Nagios-Core-Documentation/Nagios-and-Raspberry-PI/details

Yes it’s already in the Nagios Core documentation set !

Page 11: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

11© Bull, 2012

The Raspberry Pi Nagios Recipe

#apt-get update #apt-get install php5 apache2 libgd2-xpm libgd2-xpm-dev

libgd2-dev libpng12-dev libjpeg62-dev libgd-tools libpng12-dev libgd2-xpm libgd2-xpm-dev libssl-dev gnutls-bin iputils

#groupadd www-data#groupadd nagios #adduser nagios#usermod -G nagios nagios#usermod -G www-data,nagios www-data #mkdir /usr/local/nagios#chown -R nagios:nagios /usr/local/Nagios

Page 12: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

12© Bull, 2012

The Raspberry Pi Nagios Recipe

Whoops ! We also need GD-Utils….

root@raspberrypi:/tmp# wget http://www.boutell.com/gd/http/gd-2.0.33.tar.gz

root@raspberrypi:/tmp# tar -zxvf gd-2.0.33.tar.gzroot@raspberrypi:/tmp/gd-2.0.33# ./configureroot@raspberrypi:/tmp/gd-2.0.33# make && make install

Page 13: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

13© Bull, 2012

The Raspberry Pi Nagios Recipe

Now we need to get on and install:root@raspberrypi:/tmp# wget

http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.4.1.tar.gz

root@raspberrypi:/tmp# tar xzf nagios-3.4.1.tar.gzroot@raspberrypi:/tmp/nagios# ./configure

–prefix=/usr/local/nagios –with-cgiurl=/nagios/cgi-bin –with-htmurl=/nagios/ –with-nagios-user=nagios –with-nagios-group=nagios –with-command-group=nagios

And then make:root@raspberrypi:/tmp/nagios# make all

Page 14: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

14© Bull, 2012

The Raspberry Pi Nagios Recipe

root@raspberrypi:/tmp/nagios# make install-initInstall and configure the directory for that holds the external

command file:root@raspberrypi:/tmp/nagios# make install-commandmodeInstall the apache configuration:root@raspberrypi:/tmp/nagios# make install-webconfAnd at the end install the sample config files:root@raspberrypi:/tmp/nagios# make install-config Restart the apache daemon:root@raspberrypi:/tmp/nagios# /etc/init.d/apache2 reload

Page 15: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

15© Bull, 2012

The Raspberry Pi Nagios Recipe

Now for the plugins :

apt-get install nagios-plugins nagios-snmp-pluginsOr by compiling them:root@raspberrypi:/tmp# wget

http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.15.tar.gz

root@raspberrypi:/tmp# tar xzf nagios-plugins-1.4.15.tar.gzroot@raspberrypi:/tmp/nagios-plugins-1.4.15# ./configureroot@raspberrypi:/tmp/nagios-plugins-1.4.15# make && make

install

Page 16: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

16© Bull, 2012

Using DNX

1.Download the automated installation script to the /tmp directory:

# cd /tmp2. # wget

http://assets.nagios.com/downloads/nagiosxi/scripts/NagiosXI3. Make the script executable:# chmod +x NagiosXI-DNX.sh4. Run the script in client mode# ./NagiosXI-DNX.sh -c5. Repeat steps 1-4 for each slave system.6. Repeat steps 1-3 on the master Nagios server.7. Run the script in server mode, optionally enabling automatic

synchronization

Page 17: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

17© Bull, 2012

Using DNX

Of course it’s not that easy :Modify the script to run under Debian,206c206< # iptables -I INPUT -p udp --dport 12480:12482 -j ACCEPT---> iptables -I INPUT -p udp --dport 12480:12482 -j ACCEPT246c246< wget -c $DOWNLOAD_URL -o dnx-$DNX_VERSION.tar.gz---> wget -c $DOWNLOAD_URL

Page 18: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

18© Bull, 2012

Using DNX

Page 19: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

19© Bull, 2012

Demonstration

First the Raspberry Pi running Nagios & DNX

Oh – just one more thing…..

Page 20: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

20© Bull, 2012

Futures & ‘Blue Sky thinking’

No limits to the possible uses for the RaspberryPI:

Remember it has a GPIO output capability so….

• For example true ‘traffic light displays’

Page 21: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

21© Bull, 2012

Raspberry Pi , Nagios & Traffic Lights

Page 22: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

22© Bull, 2012

RaspberryPi, Nagios & Traffic Lights

Page 23: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

23© Bull, 2012

Futures & ‘Blue Sky thinking’

No limits to the possible uses for the RaspberryPI:

• Rolling text displays• Digital Signage – Screenly-ose (on github.com)

Page 24: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

24© Bull, 2012

Futures & ‘Blue Sky thinking’

3D image of Tera 100You could build a supercomputer like this

Page 25: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

25© Bull, 2012

Futures & ‘Blue Sky thinking’

Iridis-piBut with Raspberry PI it might look like this –

64 nodes using Message Passing Interface

Futures & ‘Blue Sky thinking

Page 26: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

26© Bull, 2012

Futures & ‘Blue Sky thinking’

Iridis-piPair of Raspberry PI compute nodes in their Lego racking enclosure

Futures & ‘Blue Sky thinking

Page 27: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

27© Bull, 2012

Futures & ‘Blue Sky thinking’

How about adding a simple PBX to your current Nagios set-up?

Or just two lines that tell you something ?

Page 28: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

28© Bull, 2012

Futures & ‘Blue Sky thinking’

Take data from a weather station and post Twitter feeds & web site info

Page 29: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

29© Bull, 2012

Conclusions

For $35 this is a ‘fire & forget’ solution

Quite capable of monitoring SME’s and with DNX support even larger environments

Possibly the easiest way to drive / monitor exotic devicesOnly limited by your imagination

Page 30: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

30© Bull, 2012

Questions

Page 31: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

31© Bull, 2012

Page 32: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

32© Bull, 2012

Page 33: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

33© Bull, 2012

Standard slide with title, text over two columns

First level textSecond level text

–Third level text Fourth level text

First level textSecond level text

–Third level text Fourth level text

Page 34: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

34© Bull, 2012

Colour palette

R41 V41 B41R41 V41 B41R95 V95 B95R95 V95 B95R178 V178 B178R178 V178 B178

R255 V204 B102R255 V204 B102

R0 V128 B0R0 V128 B0R119 V185 B0R119 V185 B0R151 V191 B13R151 V191 B13 R182 V0 B34R182 V0 B34R238 V134 B0R238 V134 B0

R96 V52 B129R96 V52 B129R0 V117 B182R0 V117 B182

BOOST coloursCore colours

Page 35: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

35© Bull, 2012

Click to add title

click to add text

Page 36: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

36© Bull, 2012

Standard slide with image

Le cloud by Bull logo

Page 37: Nagios Conference 2012 - Dave Williams - Embedding Nagios using RaspberyPi

37© Bull, 2012

Standard slide with title and image

3D image of Tera 100