SlideShare una empresa de Scribd logo
1 de 52
Descargar para leer sin conexión
Writing Custom Nagios Plugins

        Nathan Vonnahme
Nathan.Vonnahme@bannerhealth.com
Why write Nagios plugins?


 • Checklists are boring.
 • Life is complicated.
 • “OK” is complicated.
What tool should we use?


 Anything!


 I’ll show
   1. Perl
   2. JavaScript
   3. AutoIt


 Follow along!


                     2012
Why Perl?


 • Familiar to many sysadmins
 • Cross-platform
 • CPAN
 • Mature Nagios::Plugin API
 • Embeddable in Nagios (ePN)
 • Examples and documentation
 • “Swiss army chainsaw”
 • Perl 6… someday?

                       2012
Buuuuut I don’t like Perl




 Nagios plugins are very simple. Use any language
    you like. Eventually, imitate Nagios::Plugin.

                        2012
got Perl?


            perl.org/get.html
            Linux and Mac already have it:
              which perl
            On Windows, I prefer
              1. Strawberry Perl
              2. Cygwin (N.B. make, gcc4)
              3. ActiveState Perl
            Any version Perl 5 should work.


                2012                          6
got Documentation?


 http://nagiosplug.sf.net/
   developer-guidelines.html
 Or,
   goo.gl/kJRTI
                     Case
                   sensitive!




                            2012
got an idea?


 Check the validity of my backup file F.




                    2012
Simplest Plugin Ever


 #!/usr/bin/perl
 if (-e $ARGV[0]) { # File in first arg exists.
   print "OKn";
   exit(0);
 }
 else {
   print "CRITICALn";
   exit(2);
 }




                          2012                    9
Simplest Plugin Ever



 Save, then run with one argument:
    $ ./simple_check_backup.pl foo.tar.gz
    CRITICAL
    $ touch foo.tar.gz
    $ ./simple_check_backup.pl foo.tar.gz
    OK


 But: Will it succeed tomorrow?


                         2012
But “OK” is complicated.


 • Check the validity* of my backup file F.
    • Existent
    • Less than X hours old
    • Between Y and Z MB in size


 * further opportunity: check the restore process!
 BTW: Gavin Carr with Open Fusion in Australia has already written
   a check_file plugin that could do this, but we’re learning here.
   Also confer 2001 check_backup plugin by Patrick Greenwell, but
   it’s pre-Nagios::Plugin.


                                2012
Bells and Whistles


 • Argument parsing
 • Help/documentation
 • Thresholds
 • Performance data
 These things make
 up the majority of
 the code in any
 good plugin. We’ll
 demonstrate them all.

                         2012
Bells, Whistles, and Cowbell


 • Nagios::Plugin
   • Ton Voon rocks
   • Gavin Carr too
   • Used in production
     Nagios plugins
     everywhere
   • Since ~ 2006




                          2012
Bells, Whistles, and Cowbell


 • Install Nagios::Plugin
   sudo cpan
   Configure CPAN if necessary...
   cpan>   install Nagios::Plugin
 • Potential solutions:
   • Configure http_proxy environment variable if
     behind firewall
   • cpan> o conf prerequisites_policy follow
     cpan> o conf commit
   • cpan> install Params::Validate

                            2012
got an example plugin template?


 • Use check_stuff.pl from the Nagios::Plugin
   distribution as your template.

   goo.gl/vpBnh

 • This is always a good place to
   start a plugin.
 • We’re going to be turning
   check_stuff.pl into the finished
   check_backup.pl example.
                         2012
got the finished example?

Published with Gist:
     https://gist.github.com/1218081
or


goo.gl/hXnSm
• Note the “raw” hyperlink for downloading the
  Perl source code.
• The roman numerals in the comments match
  the next series of slides.
                             2012
Check your setup

 1. Save check_stuff.pl (goo.gl/vpBnh) as e.g.
    my_check_backup.pl.
 2. Change the first “shebang” line to point to the Perl
    executable on your machine.
       #!c:/strawberry/bin/perl
 3. Run it
       ./my_check_backup.pl
 4. You should get:
   MY_CHECK_BACKUP UNKNOWN -   you didn't supply a threshold
       argument

 5. If yours works, help your neighbors.

                                2012
Design: Which arguments do we need?


 • File name
 • Age in hours
 • Size in MB




                     2012
Design: Thresholds


 • Non-existence: CRITICAL
 • Age problem: CRITICAL if over age threshold
 • Size problem: WARNING if outside size
   threshold (min:max)




                       2012
I. Prologue (working from check_stuff.pl)


 use strict;
 use warnings;

 use Nagios::Plugin;
 use File::stat;

 use vars qw($VERSION $PROGNAME $verbose $timeout
 $result);
 $VERSION = '1.0';

 # get the base name of this script for use in the
 examples
 use File::Basename;
 $PROGNAME = basename($0);


                          2012
II. Usage/Help

 Changes from check_stuff.pl in bold
 my $p = Nagios::Plugin->new(
   usage => "Usage: %s [ -v|--verbose ] [-t <timeout>]
 [ -f|--file=<path/to/backup/file> ]
 [ -a|--age=<max age in hours> ]
 [ -s|--size=<acceptable min:max size in MB> ]",

   version => $VERSION,
   blurb => "Check the specified backup file's age and size",
   extra => "
 Examples:

 $PROGNAME -f /backups/foo.tgz -a 24 -s 1024:2048

 Check that foo.tgz exists, is less than 24 hours old, and is
 between
 1024 and 2048 MB.
 “);

                                2012
III. Command line arguments/options

 Replace the 3 add_arg calls from check_stuff.pl with:
 # See Getopt::Long for more
 $p->add_arg(
     spec => 'file|f=s',
     required => 1,
     help => "-f, --file=STRING
         The backup file to check. REQUIRED.");
 $p->add_arg(
     spec => 'age|a=i',
     default => 24,
     help => "-a, --age=INTEGER
         Maximum age in hours. Default 24.");
 $p->add_arg(
     spec => 'size|s=s',
     help => "-s, --size=INTEGER:INTEGER
         Minimum:maximum acceptable size in MB (1,000,000 bytes)");

 # Parse arguments and process standard ones (e.g. usage, help, version)
 $p->getopts;



                                   2012
Now it’s RTFM-enabled


 If you run it with no args, it shows usage:

 $ ./check_backup.pl
 Usage: check_backup.pl [ -v|--verbose ] [-t
 <timeout>]
     [ -f|--file=<path/to/backup/file> ]
     [ -a|--age=<max age in hours> ]
     [ -s|--size=<acceptable min:max size in MB> ]




                          2012
Now it’s RTFM-enabled

 $ ./check_backup.pl --help
    check_backup.pl 1.0

    This nagios plugin is free software, and comes with ABSOLUTELY NO WARRANTY.
    It may be used, redistributed and/or modified under the terms of the GNU
    General Public Licence (see http://www.fsf.org/licensing/licenses/gpl.txt).

    Check the specified backup file's age and size

    Usage: check_backup.pl [ -v|--verbose ] [-t <timeout>]
        [ -f|--file=<path/to/backup/file> ]
        [ -a|--age=<max age in hours> ]
        [ -s|--size=<acceptable min:max size in MB> ]

     -?, --usage
       Print usage information
     -h, --help
       Print detailed help screen
     -V, --version
       Print version information



                                       2012
Now it’s RTFM-enabled

   --extra-opts=[section][@file]
     Read options from an ini file. See http://nagiosplugins.org/extra-opts
     for usage and examples.
   -f, --file=STRING
                      The backup file to check. REQUIRED.
   -a, --age=INTEGER
                  Maximum age in hours. Default 24.
   -s, --size=INTEGER:INTEGER
                   Minimum:maximum acceptable size in MB (1,000,000 bytes)
   -t, --timeout=INTEGER
     Seconds before plugin times out (default: 15)
   -v, --verbose
     Show details for command-line debugging (can repeat up to 3 times)

    Examples:

      check_backup.pl -f /backups/foo.tgz -a 24 -s 1024:2048

    Check that foo.tgz exists, is less than 24 hours old, and is between
    1024 and 2048 MB.



                                     2012
IV. Check arguments for sanity


 • Basic syntax checks already defined with
   add_arg, but replace the “sanity checking” with:

 # Perform sanity checking on command line options.
 if ( (defined $p->opts->age) && $p->opts->age < 0 ) {
      $p->nagios_die( " invalid number supplied for
 the age option " );
 }



 • Your next plugin may be more complex.


                          2012
Ooops




At first I used -M, which Perl defines as “Script
  start time minus file modification time, in days.”
Nagios uses embedded Perl by default so the
 “script start time” may be hours or days ago.

                         2012
V. Check the stuff

 # Check the backup file.
 my $f = $p->opts->file;
 unless (-e $f) {
   $p->nagios_exit(CRITICAL, "File $f doesn't exist");
 }
 my $mtime = File::stat::stat($f)->mtime;
 my $age_in_hours = (time - $mtime) / 60 / 60;
 my $size_in_mb = (-s $f) / 1_000_000;

 my $message = sprintf
     "Backup exists, %.0f hours old, %.1f MB.",
     $age_in_hours, $size_in_mb;




                          2012
VI. Performance Data

 # Add perfdata, enabling pretty graphs etc.
 $p->add_perfdata(
    label => "age",
    value => $age_in_hours,
    uom => "hours"
 );
 $p->add_perfdata(
    label => "size",
    value => $size_in_mb,
    uom => "MB"
 );

 • This adds Nagios-friendly output like:
    | age=2.91611111111111hours;; size=0.515007MB;;


                          2012
VII. Compare to thresholds

 Add this section. check_stuff.pl combines
 check_threshold with nagios_exit at the very end.
 # We already checked for file existence.
 my $result = $p->check_threshold(
     check => $age_in_hours,
     warning => undef,
     critical => $p->opts->age
 );
 if ($result == OK) {
     $result = $p->check_threshold(
         check => $size_in_mb,
         warning => $p->opts->size,
         critical => undef,
     );
 }

                          2012
VIII. Exit Code


 # Output the result and exit.
 $p->nagios_exit(
     return_code => $result,
     message => $message
 );




                       2012
Testing the plugin
 $ ./check_backup.pl -f foo.gz
 BACKUP OK - Backup exists, 3 hours old, 0.5 MB |
   age=3.04916666666667hours;; size=0.515007MB;;


 $ ./check_backup.pl -f foo.gz   -s 100:900
 BACKUP WARNING - Backup exists, 23 hours old, 0.5 MB
   | age=23.4275hours;; size=0.515007MB;;


 $ ./check_backup.pl -f foo.gz   -a 8
 BACKUP CRITICAL - Backup exists, 23 hours old, 0.5 MB
   | age=23.4388888888889hours;; size=0.515007MB;;



                          2012
Telling Nagios to use your plugin


     1. misccommands.cfg*

 define command{
   command_name      check_backup
   command_line      $USER1$/myplugins/check_backup.pl
                       -f $ARG1$ -a $ARG2$ -s $ARG3$
 }




     * Lines wrapped for slide presentation


                             2012
Telling Nagios to use your plugin


   2. services.cfg (wrapped)
   define service{
     use                     generic-service
     normal_check_interval   1440    # 24 hours
     host_name               fai01337
     service_description     MySQL backups
     check_command           check_backup!/usr/local/backups
                               /mysql/fai01337.mysql.dump.bz2
                               !24!0.5:100
       contact_groups        linux-admins
   }


   3. Reload config:
       $ sudo /usr/bin/nagios -v /etc/nagios/nagios.cfg
          && sudo /etc/rc.d/init.d/nagios reload

                                2012
Remote execution


 • Hosts/filesystems other than the Nagios host
 • Requirements
   • NRPE, NSClient or equivalent
   • Perl with Nagios::Plugin




                           2012
Profit


 $ plugins/check_nt -H winhost -p 1248
   -v RUNSCRIPT -l check_my_backup.bat


 OK - Backup exists, 12 hours old, 35.7
   MB | age=12.4527777777778hours;;
   size=35.74016MB;;




                    2012
Share



 exchange.
 nagios.org




              2012
Other tools and languages


 • C
 • TAP – Test Anything Protocol
   • See check_tap.pl from my other talk
 • Python
 • Shell
 • Ruby? C#? VB? JavaScript?
 • AutoIt!



                           2012
Now in JavaScript


 Why JavaScript?
 • Node.js “Node's problem is that some of its
   users want to use it for everything? So what? “
 • Cool kids
 • Crockford
 • “Always bet on JS” – Brendan Eich




                         2012
Check_stuff.js – the short part

 var plugin_name = 'CHECK_STUFF';


 // Set up command line args and usage etc using commander.js.
 var cli = require('commander');


 cli
  .version('0.0.1')
    .option('-c, --critical <critical threshold>', 'Critical threshold
   using standard format', parseRangeString)
    .option('-w, --warning <warning threshold>', 'Warning threshold
   using standard format', parseRangeString)
    .option('-r, --result <Number4>', 'Use supplied value, not
   random', parseFloat)
  .parse(process.argv);

                                    2012
Check_stuff.js – the short part

 if (val == undefined) {
     val = Math.floor((Math.random() * 20) + 1);
 }
 var message = ' Sample result was ' + val.toString();

 var perfdata = "'Val'="+val + ';' + cli.warning + ';' +
    cli.critical + ';';

 if (cli.critical && cli.critical.check(val)) {
     nagios_exit(plugin_name, "CRITICAL", message, perfdata);
 } else if (cli.warning && cli.warning.check(val)) {
     nagios_exit(plugin_name, "WARNING", message, perfdata);
 } else {
     nagios_exit(plugin_name, "OK", message, perfdata);
 }




                                2012
The rest


 • Range object
   • Range.toString()
   • Range.check()
   • Range.parseRangeString()
 • nagios_exit()


 Who’s going to make it an NPM module?



                        2012
A silly but newfangled example


 Facebook friends is WARNING!


 ./check_facebook_friends.js -u
   nathan.vonnahme -w @202 -c @203




                      2012
Check_facebook_friends.js


 See the code at

  gist.github.com/3760536
 Note: functions as callbacks instead of loops or
  waiting...




                         2012
A horrifying/inspiring example


    The worst things need the most monitoring.




                       2012
Chart “servers”


 • MS Word macro
 • Mail merge
 • Runs in user session
 • Need about a dozen




                          2012
It gets worse.


                   • Not a service
                   • Not even a process
                   • 100% CPU is normal
                   • “OK” is complicated.




                 2012
Many failure modes




                     2012
AutoIt to the rescue
 Func CompareTitles()
   For $title=1 To $all_window_titles[0][0] Step 1     If
     $state=WinGetState($all_window_titles[$title][0])     StringRegExp($all_window_titles[$title][0], $vali
     $foo=0                                                d_windows[0])=1 Then
     $do_test=0
     For $foo In $valid_states                             $expression=ControlGetText($all_window_titles[$ti
       If $state=$foo Then                                 tle][0], "", 1013)
          $do_test +=1                                        EndIf
       EndIf                                               EndIf
     Next                                                Next
     If $all_window_titles[$title][0] <> "" AND          $no_bad_windows=1
     $do_test>0 Then                                   EndFunc
       $window_is_valid=0
                                                       Func NagiosExit()
       For $string=0 To $num_of_strings-1 Step 1         ConsoleWrite($detailed_status)
                                                         Exit($return)
     $match=StringRegExp($all_window_titles[$title][0] EndFunc
     , $valid_windows[$string])
          $window_is_valid += $match                   CompareTitles()
       Next
                                                       if $no_bad_windows=1 Then
       if $window_is_valid=0 Then                          $detailed_status="No chartserver anomalies at
          $return=2                                        this time -- " & $expression
          $detailed_status="Unexpected window *" &         $return=0
     $all_window_titles[$title][0] & "* present" & @LF EndIf
     & "***" & $all_window_titles[$title][0] & "***
     doesn't match anything we expect."                NagiosExit()
          NagiosExit()
       EndIf




                                                    2012
Nagios now knows when they’re broken




                     2012
Life is complicated
 “OK” is complicated.
 Custom plugins make Nagios much smarter about
  your environment.




                        2012
Questions?
               Comments?
       Perl and JS plugin example code at
              gist.github.com/n8v




2012

Más contenido relacionado

La actualidad más candente

Docker workshop 0507 Taichung
Docker workshop 0507 Taichung Docker workshop 0507 Taichung
Docker workshop 0507 Taichung Paul Chao
 
Hyperledger composer
Hyperledger composerHyperledger composer
Hyperledger composerwonyong hwang
 
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)Chu-Siang Lai
 
Asynchronous Systems with Fn Flow
Asynchronous Systems with Fn FlowAsynchronous Systems with Fn Flow
Asynchronous Systems with Fn FlowJosé Paumard
 
Python virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesPython virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesLarry Cai
 
Configuring Django projects for multiple environments
Configuring Django projects for multiple environmentsConfiguring Django projects for multiple environments
Configuring Django projects for multiple environmentsApptension
 
Real World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js ApplicationsReal World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js ApplicationsBen Hall
 
Stop Worrying & Love the SQL - A Case Study
Stop Worrying & Love the SQL - A Case StudyStop Worrying & Love the SQL - A Case Study
Stop Worrying & Love the SQL - A Case StudyAll Things Open
 
開放運算&GPU技術研究班
開放運算&GPU技術研究班開放運算&GPU技術研究班
開放運算&GPU技術研究班Paul Chao
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017手把手帶你學Docker 03042017
手把手帶你學Docker 03042017Paul Chao
 
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015Fastly
 
Hw09 Monitoring Best Practices
Hw09   Monitoring Best PracticesHw09   Monitoring Best Practices
Hw09 Monitoring Best PracticesCloudera, Inc.
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Ben Hall
 
Creating PostgreSQL-as-a-Service at Scale
Creating PostgreSQL-as-a-Service at ScaleCreating PostgreSQL-as-a-Service at Scale
Creating PostgreSQL-as-a-Service at ScaleSean Chittenden
 
Ansible 實戰:top down 觀點
Ansible 實戰:top down 觀點Ansible 實戰:top down 觀點
Ansible 實戰:top down 觀點William Yeh
 
Go語言開發APM微服務在Kubernetes之經驗分享
Go語言開發APM微服務在Kubernetes之經驗分享Go語言開發APM微服務在Kubernetes之經驗分享
Go語言開發APM微服務在Kubernetes之經驗分享Te-Yen Liu
 

La actualidad más candente (20)

Docker workshop 0507 Taichung
Docker workshop 0507 Taichung Docker workshop 0507 Taichung
Docker workshop 0507 Taichung
 
ABCs of docker
ABCs of dockerABCs of docker
ABCs of docker
 
groovy & grails - lecture 13
groovy & grails - lecture 13groovy & grails - lecture 13
groovy & grails - lecture 13
 
Hyperledger composer
Hyperledger composerHyperledger composer
Hyperledger composer
 
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
 
Asynchronous Systems with Fn Flow
Asynchronous Systems with Fn FlowAsynchronous Systems with Fn Flow
Asynchronous Systems with Fn Flow
 
Python virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesPython virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutes
 
Configuring Django projects for multiple environments
Configuring Django projects for multiple environmentsConfiguring Django projects for multiple environments
Configuring Django projects for multiple environments
 
Real World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js ApplicationsReal World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js Applications
 
Stop Worrying & Love the SQL - A Case Study
Stop Worrying & Love the SQL - A Case StudyStop Worrying & Love the SQL - A Case Study
Stop Worrying & Love the SQL - A Case Study
 
開放運算&GPU技術研究班
開放運算&GPU技術研究班開放運算&GPU技術研究班
開放運算&GPU技術研究班
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017手把手帶你學Docker 03042017
手把手帶你學Docker 03042017
 
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015
 
Hw09 Monitoring Best Practices
Hw09   Monitoring Best PracticesHw09   Monitoring Best Practices
Hw09 Monitoring Best Practices
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)
 
Creating PostgreSQL-as-a-Service at Scale
Creating PostgreSQL-as-a-Service at ScaleCreating PostgreSQL-as-a-Service at Scale
Creating PostgreSQL-as-a-Service at Scale
 
Ansible 實戰:top down 觀點
Ansible 實戰:top down 觀點Ansible 實戰:top down 觀點
Ansible 實戰:top down 觀點
 
Go語言開發APM微服務在Kubernetes之經驗分享
Go語言開發APM微服務在Kubernetes之經驗分享Go語言開發APM微服務在Kubernetes之經驗分享
Go語言開發APM微服務在Kubernetes之經驗分享
 
Docker practice
Docker practiceDocker practice
Docker practice
 
Boycott Docker
Boycott DockerBoycott Docker
Boycott Docker
 

Destacado

Nagios Conference 2011 - Nathan Vonnahme - Writing Custom Nagios Plugins In Perl
Nagios Conference 2011 - Nathan Vonnahme - Writing Custom Nagios Plugins In PerlNagios Conference 2011 - Nathan Vonnahme - Writing Custom Nagios Plugins In Perl
Nagios Conference 2011 - Nathan Vonnahme - Writing Custom Nagios Plugins In PerlNagios
 
Writing Nagios Plugins in Python
Writing Nagios Plugins in PythonWriting Nagios Plugins in Python
Writing Nagios Plugins in Pythonguesta6e653
 
Janice Singh - Writing Custom Nagios Plugins
Janice Singh - Writing Custom Nagios PluginsJanice Singh - Writing Custom Nagios Plugins
Janice Singh - Writing Custom Nagios PluginsNagios
 
Nagios Conference 2013 - William Leibzon - SNMP Protocol and Nagios Plugins
Nagios Conference 2013 - William Leibzon - SNMP Protocol and Nagios PluginsNagios Conference 2013 - William Leibzon - SNMP Protocol and Nagios Plugins
Nagios Conference 2013 - William Leibzon - SNMP Protocol and Nagios PluginsNagios
 
Jesse Olson - Nagios Log Server Architecture Overview
Jesse Olson - Nagios Log Server Architecture OverviewJesse Olson - Nagios Log Server Architecture Overview
Jesse Olson - Nagios Log Server Architecture OverviewNagios
 
Nagios XI Best Practices
Nagios XI Best PracticesNagios XI Best Practices
Nagios XI Best PracticesNagios
 

Destacado (7)

Writing nagios plugins in perl
Writing nagios plugins in perlWriting nagios plugins in perl
Writing nagios plugins in perl
 
Nagios Conference 2011 - Nathan Vonnahme - Writing Custom Nagios Plugins In Perl
Nagios Conference 2011 - Nathan Vonnahme - Writing Custom Nagios Plugins In PerlNagios Conference 2011 - Nathan Vonnahme - Writing Custom Nagios Plugins In Perl
Nagios Conference 2011 - Nathan Vonnahme - Writing Custom Nagios Plugins In Perl
 
Writing Nagios Plugins in Python
Writing Nagios Plugins in PythonWriting Nagios Plugins in Python
Writing Nagios Plugins in Python
 
Janice Singh - Writing Custom Nagios Plugins
Janice Singh - Writing Custom Nagios PluginsJanice Singh - Writing Custom Nagios Plugins
Janice Singh - Writing Custom Nagios Plugins
 
Nagios Conference 2013 - William Leibzon - SNMP Protocol and Nagios Plugins
Nagios Conference 2013 - William Leibzon - SNMP Protocol and Nagios PluginsNagios Conference 2013 - William Leibzon - SNMP Protocol and Nagios Plugins
Nagios Conference 2013 - William Leibzon - SNMP Protocol and Nagios Plugins
 
Jesse Olson - Nagios Log Server Architecture Overview
Jesse Olson - Nagios Log Server Architecture OverviewJesse Olson - Nagios Log Server Architecture Overview
Jesse Olson - Nagios Log Server Architecture Overview
 
Nagios XI Best Practices
Nagios XI Best PracticesNagios XI Best Practices
Nagios XI Best Practices
 

Similar a Nagios Conference 2012 - Nathan Vonnahme - Writing Custom Nagios Plugins in Perl

Getting Started With CFEngine - Updated Version
Getting Started With CFEngine - Updated VersionGetting Started With CFEngine - Updated Version
Getting Started With CFEngine - Updated VersionCFEngine
 
Django dev-env-my-way
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-wayRobert Lujo
 
Software development practices in python
Software development practices in pythonSoftware development practices in python
Software development practices in pythonJimmy Lai
 
Nagios Conference 2007 | State of the Plugins by Ton Voon
Nagios Conference 2007 | State of the Plugins by Ton VoonNagios Conference 2007 | State of the Plugins by Ton Voon
Nagios Conference 2007 | State of the Plugins by Ton VoonNETWAYS
 
Golang @ Tokopedia
Golang @ TokopediaGolang @ Tokopedia
Golang @ TokopediaQasim Zaidi
 
Howto Test A Patch And Make A Difference!
Howto Test A Patch And Make A Difference!Howto Test A Patch And Make A Difference!
Howto Test A Patch And Make A Difference!Joel Farris
 
Chef - industrialize and automate your infrastructure
Chef - industrialize and automate your infrastructureChef - industrialize and automate your infrastructure
Chef - industrialize and automate your infrastructureMichaël Lopez
 
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat Pôle Systematic Paris-Region
 
Zero Downtime Deployment with Ansible
Zero Downtime Deployment with AnsibleZero Downtime Deployment with Ansible
Zero Downtime Deployment with AnsibleStein Inge Morisbak
 
Workflow automation for Front-end web applications
Workflow automation for Front-end web applicationsWorkflow automation for Front-end web applications
Workflow automation for Front-end web applicationsMayank Patel
 
Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?AFUP_Limoges
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using SwiftDiego Freniche Brito
 
Kubernetes - State of the Union (Q1-2016)
Kubernetes - State of the Union (Q1-2016)Kubernetes - State of the Union (Q1-2016)
Kubernetes - State of the Union (Q1-2016)DoiT International
 
Automate DBA Tasks With Ansible
Automate DBA Tasks With AnsibleAutomate DBA Tasks With Ansible
Automate DBA Tasks With AnsibleIvica Arsov
 
Autotests introduction - Codeception + PHP Basics
Autotests introduction - Codeception + PHP BasicsAutotests introduction - Codeception + PHP Basics
Autotests introduction - Codeception + PHP BasicsArtur Babyuk
 
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017MarcinStachniuk
 
Packaging for the Maemo Platform
Packaging for the Maemo PlatformPackaging for the Maemo Platform
Packaging for the Maemo PlatformJeremiah Foster
 
Buildr - build like you code
Buildr -  build like you codeBuildr -  build like you code
Buildr - build like you codeIzzet Mustafaiev
 
ContainerDayVietnam2016: Django Development with Docker
ContainerDayVietnam2016: Django Development with DockerContainerDayVietnam2016: Django Development with Docker
ContainerDayVietnam2016: Django Development with DockerDocker-Hanoi
 

Similar a Nagios Conference 2012 - Nathan Vonnahme - Writing Custom Nagios Plugins in Perl (20)

Getting Started With CFEngine - Updated Version
Getting Started With CFEngine - Updated VersionGetting Started With CFEngine - Updated Version
Getting Started With CFEngine - Updated Version
 
Django dev-env-my-way
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-way
 
Software development practices in python
Software development practices in pythonSoftware development practices in python
Software development practices in python
 
Nagios Conference 2007 | State of the Plugins by Ton Voon
Nagios Conference 2007 | State of the Plugins by Ton VoonNagios Conference 2007 | State of the Plugins by Ton Voon
Nagios Conference 2007 | State of the Plugins by Ton Voon
 
Golang @ Tokopedia
Golang @ TokopediaGolang @ Tokopedia
Golang @ Tokopedia
 
Howto Test A Patch And Make A Difference!
Howto Test A Patch And Make A Difference!Howto Test A Patch And Make A Difference!
Howto Test A Patch And Make A Difference!
 
Chef - industrialize and automate your infrastructure
Chef - industrialize and automate your infrastructureChef - industrialize and automate your infrastructure
Chef - industrialize and automate your infrastructure
 
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
 
Zero Downtime Deployment with Ansible
Zero Downtime Deployment with AnsibleZero Downtime Deployment with Ansible
Zero Downtime Deployment with Ansible
 
Workflow automation for Front-end web applications
Workflow automation for Front-end web applicationsWorkflow automation for Front-end web applications
Workflow automation for Front-end web applications
 
Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
 
Kubernetes - State of the Union (Q1-2016)
Kubernetes - State of the Union (Q1-2016)Kubernetes - State of the Union (Q1-2016)
Kubernetes - State of the Union (Q1-2016)
 
Automate DBA Tasks With Ansible
Automate DBA Tasks With AnsibleAutomate DBA Tasks With Ansible
Automate DBA Tasks With Ansible
 
Autotests introduction - Codeception + PHP Basics
Autotests introduction - Codeception + PHP BasicsAutotests introduction - Codeception + PHP Basics
Autotests introduction - Codeception + PHP Basics
 
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
 
Packaging for the Maemo Platform
Packaging for the Maemo PlatformPackaging for the Maemo Platform
Packaging for the Maemo Platform
 
R sharing 101
R sharing 101R sharing 101
R sharing 101
 
Buildr - build like you code
Buildr -  build like you codeBuildr -  build like you code
Buildr - build like you code
 
ContainerDayVietnam2016: Django Development with Docker
ContainerDayVietnam2016: Django Development with DockerContainerDayVietnam2016: Django Development with Docker
ContainerDayVietnam2016: Django Development with Docker
 

Más de Nagios

Trevor McDonald - Nagios XI Under The Hood
Trevor McDonald  - Nagios XI Under The HoodTrevor McDonald  - Nagios XI Under The Hood
Trevor McDonald - Nagios XI Under The HoodNagios
 
Sean Falzon - Nagios - Resilient Notifications
Sean Falzon - Nagios - Resilient NotificationsSean Falzon - Nagios - Resilient Notifications
Sean Falzon - Nagios - Resilient NotificationsNagios
 
Marcus Rochelle - Landis+Gyr - Monitoring with Nagios Enterprise Edition
Marcus Rochelle - Landis+Gyr - Monitoring with Nagios Enterprise EditionMarcus Rochelle - Landis+Gyr - Monitoring with Nagios Enterprise Edition
Marcus Rochelle - Landis+Gyr - Monitoring with Nagios Enterprise EditionNagios
 
Dave Williams - Nagios Log Server - Practical Experience
Dave Williams - Nagios Log Server - Practical ExperienceDave Williams - Nagios Log Server - Practical Experience
Dave Williams - Nagios Log Server - Practical ExperienceNagios
 
Mike Weber - Nagios and Group Deployment of Service Checks
Mike Weber - Nagios and Group Deployment of Service ChecksMike Weber - Nagios and Group Deployment of Service Checks
Mike Weber - Nagios and Group Deployment of Service ChecksNagios
 
Mike Guthrie - Revamping Your 10 Year Old Nagios Installation
Mike Guthrie - Revamping Your 10 Year Old Nagios InstallationMike Guthrie - Revamping Your 10 Year Old Nagios Installation
Mike Guthrie - Revamping Your 10 Year Old Nagios InstallationNagios
 
Bryan Heden - Agile Networks - Using Nagios XI as the platform for Monitoring...
Bryan Heden - Agile Networks - Using Nagios XI as the platform for Monitoring...Bryan Heden - Agile Networks - Using Nagios XI as the platform for Monitoring...
Bryan Heden - Agile Networks - Using Nagios XI as the platform for Monitoring...Nagios
 
Matt Bruzek - Monitoring Your Public Cloud With Nagios
Matt Bruzek - Monitoring Your Public Cloud With NagiosMatt Bruzek - Monitoring Your Public Cloud With Nagios
Matt Bruzek - Monitoring Your Public Cloud With NagiosNagios
 
Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.
Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.
Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.Nagios
 
Eric Loyd - Fractal Nagios
Eric Loyd - Fractal NagiosEric Loyd - Fractal Nagios
Eric Loyd - Fractal NagiosNagios
 
Marcelo Perazolo, Lead Software Architect, IBM Corporation - Monitoring a Pow...
Marcelo Perazolo, Lead Software Architect, IBM Corporation - Monitoring a Pow...Marcelo Perazolo, Lead Software Architect, IBM Corporation - Monitoring a Pow...
Marcelo Perazolo, Lead Software Architect, IBM Corporation - Monitoring a Pow...Nagios
 
Thomas Schmainda - Tracking Boeing Satellites With Nagios - Nagios World Conf...
Thomas Schmainda - Tracking Boeing Satellites With Nagios - Nagios World Conf...Thomas Schmainda - Tracking Boeing Satellites With Nagios - Nagios World Conf...
Thomas Schmainda - Tracking Boeing Satellites With Nagios - Nagios World Conf...Nagios
 
Nagios World Conference 2015 - Scott Wilkerson Opening
Nagios World Conference 2015 - Scott Wilkerson OpeningNagios World Conference 2015 - Scott Wilkerson Opening
Nagios World Conference 2015 - Scott Wilkerson OpeningNagios
 
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios CoreNrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios CoreNagios
 
Nagios Log Server - Features
Nagios Log Server - FeaturesNagios Log Server - Features
Nagios Log Server - FeaturesNagios
 
Nagios Network Analyzer - Features
Nagios Network Analyzer - FeaturesNagios Network Analyzer - Features
Nagios Network Analyzer - FeaturesNagios
 
Nagios Conference 2014 - Dorance Martinez Cortes - Customizing Nagios
Nagios Conference 2014 - Dorance Martinez Cortes - Customizing NagiosNagios Conference 2014 - Dorance Martinez Cortes - Customizing Nagios
Nagios Conference 2014 - Dorance Martinez Cortes - Customizing NagiosNagios
 
Nagios Conference 2014 - Mike Weber - Nagios Rapid Deployment Options
Nagios Conference 2014 - Mike Weber - Nagios Rapid Deployment OptionsNagios Conference 2014 - Mike Weber - Nagios Rapid Deployment Options
Nagios Conference 2014 - Mike Weber - Nagios Rapid Deployment OptionsNagios
 
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios CoreNagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios CoreNagios
 
Nagios Conference 2014 - Trevor McDonald - Monitoring The Physical World With...
Nagios Conference 2014 - Trevor McDonald - Monitoring The Physical World With...Nagios Conference 2014 - Trevor McDonald - Monitoring The Physical World With...
Nagios Conference 2014 - Trevor McDonald - Monitoring The Physical World With...Nagios
 

Más de Nagios (20)

Trevor McDonald - Nagios XI Under The Hood
Trevor McDonald  - Nagios XI Under The HoodTrevor McDonald  - Nagios XI Under The Hood
Trevor McDonald - Nagios XI Under The Hood
 
Sean Falzon - Nagios - Resilient Notifications
Sean Falzon - Nagios - Resilient NotificationsSean Falzon - Nagios - Resilient Notifications
Sean Falzon - Nagios - Resilient Notifications
 
Marcus Rochelle - Landis+Gyr - Monitoring with Nagios Enterprise Edition
Marcus Rochelle - Landis+Gyr - Monitoring with Nagios Enterprise EditionMarcus Rochelle - Landis+Gyr - Monitoring with Nagios Enterprise Edition
Marcus Rochelle - Landis+Gyr - Monitoring with Nagios Enterprise Edition
 
Dave Williams - Nagios Log Server - Practical Experience
Dave Williams - Nagios Log Server - Practical ExperienceDave Williams - Nagios Log Server - Practical Experience
Dave Williams - Nagios Log Server - Practical Experience
 
Mike Weber - Nagios and Group Deployment of Service Checks
Mike Weber - Nagios and Group Deployment of Service ChecksMike Weber - Nagios and Group Deployment of Service Checks
Mike Weber - Nagios and Group Deployment of Service Checks
 
Mike Guthrie - Revamping Your 10 Year Old Nagios Installation
Mike Guthrie - Revamping Your 10 Year Old Nagios InstallationMike Guthrie - Revamping Your 10 Year Old Nagios Installation
Mike Guthrie - Revamping Your 10 Year Old Nagios Installation
 
Bryan Heden - Agile Networks - Using Nagios XI as the platform for Monitoring...
Bryan Heden - Agile Networks - Using Nagios XI as the platform for Monitoring...Bryan Heden - Agile Networks - Using Nagios XI as the platform for Monitoring...
Bryan Heden - Agile Networks - Using Nagios XI as the platform for Monitoring...
 
Matt Bruzek - Monitoring Your Public Cloud With Nagios
Matt Bruzek - Monitoring Your Public Cloud With NagiosMatt Bruzek - Monitoring Your Public Cloud With Nagios
Matt Bruzek - Monitoring Your Public Cloud With Nagios
 
Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.
Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.
Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.
 
Eric Loyd - Fractal Nagios
Eric Loyd - Fractal NagiosEric Loyd - Fractal Nagios
Eric Loyd - Fractal Nagios
 
Marcelo Perazolo, Lead Software Architect, IBM Corporation - Monitoring a Pow...
Marcelo Perazolo, Lead Software Architect, IBM Corporation - Monitoring a Pow...Marcelo Perazolo, Lead Software Architect, IBM Corporation - Monitoring a Pow...
Marcelo Perazolo, Lead Software Architect, IBM Corporation - Monitoring a Pow...
 
Thomas Schmainda - Tracking Boeing Satellites With Nagios - Nagios World Conf...
Thomas Schmainda - Tracking Boeing Satellites With Nagios - Nagios World Conf...Thomas Schmainda - Tracking Boeing Satellites With Nagios - Nagios World Conf...
Thomas Schmainda - Tracking Boeing Satellites With Nagios - Nagios World Conf...
 
Nagios World Conference 2015 - Scott Wilkerson Opening
Nagios World Conference 2015 - Scott Wilkerson OpeningNagios World Conference 2015 - Scott Wilkerson Opening
Nagios World Conference 2015 - Scott Wilkerson Opening
 
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios CoreNrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core
 
Nagios Log Server - Features
Nagios Log Server - FeaturesNagios Log Server - Features
Nagios Log Server - Features
 
Nagios Network Analyzer - Features
Nagios Network Analyzer - FeaturesNagios Network Analyzer - Features
Nagios Network Analyzer - Features
 
Nagios Conference 2014 - Dorance Martinez Cortes - Customizing Nagios
Nagios Conference 2014 - Dorance Martinez Cortes - Customizing NagiosNagios Conference 2014 - Dorance Martinez Cortes - Customizing Nagios
Nagios Conference 2014 - Dorance Martinez Cortes - Customizing Nagios
 
Nagios Conference 2014 - Mike Weber - Nagios Rapid Deployment Options
Nagios Conference 2014 - Mike Weber - Nagios Rapid Deployment OptionsNagios Conference 2014 - Mike Weber - Nagios Rapid Deployment Options
Nagios Conference 2014 - Mike Weber - Nagios Rapid Deployment Options
 
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios CoreNagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
 
Nagios Conference 2014 - Trevor McDonald - Monitoring The Physical World With...
Nagios Conference 2014 - Trevor McDonald - Monitoring The Physical World With...Nagios Conference 2014 - Trevor McDonald - Monitoring The Physical World With...
Nagios Conference 2014 - Trevor McDonald - Monitoring The Physical World With...
 

Último

Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Mark Simos
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...BookNet Canada
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 

Último (20)

Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 

Nagios Conference 2012 - Nathan Vonnahme - Writing Custom Nagios Plugins in Perl

  • 1. Writing Custom Nagios Plugins Nathan Vonnahme Nathan.Vonnahme@bannerhealth.com
  • 2. Why write Nagios plugins? • Checklists are boring. • Life is complicated. • “OK” is complicated.
  • 3. What tool should we use? Anything! I’ll show 1. Perl 2. JavaScript 3. AutoIt Follow along! 2012
  • 4. Why Perl? • Familiar to many sysadmins • Cross-platform • CPAN • Mature Nagios::Plugin API • Embeddable in Nagios (ePN) • Examples and documentation • “Swiss army chainsaw” • Perl 6… someday? 2012
  • 5. Buuuuut I don’t like Perl Nagios plugins are very simple. Use any language you like. Eventually, imitate Nagios::Plugin. 2012
  • 6. got Perl? perl.org/get.html Linux and Mac already have it: which perl On Windows, I prefer 1. Strawberry Perl 2. Cygwin (N.B. make, gcc4) 3. ActiveState Perl Any version Perl 5 should work. 2012 6
  • 7. got Documentation? http://nagiosplug.sf.net/ developer-guidelines.html Or, goo.gl/kJRTI Case sensitive! 2012
  • 8. got an idea? Check the validity of my backup file F. 2012
  • 9. Simplest Plugin Ever #!/usr/bin/perl if (-e $ARGV[0]) { # File in first arg exists. print "OKn"; exit(0); } else { print "CRITICALn"; exit(2); } 2012 9
  • 10. Simplest Plugin Ever Save, then run with one argument: $ ./simple_check_backup.pl foo.tar.gz CRITICAL $ touch foo.tar.gz $ ./simple_check_backup.pl foo.tar.gz OK But: Will it succeed tomorrow? 2012
  • 11. But “OK” is complicated. • Check the validity* of my backup file F. • Existent • Less than X hours old • Between Y and Z MB in size * further opportunity: check the restore process! BTW: Gavin Carr with Open Fusion in Australia has already written a check_file plugin that could do this, but we’re learning here. Also confer 2001 check_backup plugin by Patrick Greenwell, but it’s pre-Nagios::Plugin. 2012
  • 12. Bells and Whistles • Argument parsing • Help/documentation • Thresholds • Performance data These things make up the majority of the code in any good plugin. We’ll demonstrate them all. 2012
  • 13. Bells, Whistles, and Cowbell • Nagios::Plugin • Ton Voon rocks • Gavin Carr too • Used in production Nagios plugins everywhere • Since ~ 2006 2012
  • 14. Bells, Whistles, and Cowbell • Install Nagios::Plugin sudo cpan Configure CPAN if necessary... cpan> install Nagios::Plugin • Potential solutions: • Configure http_proxy environment variable if behind firewall • cpan> o conf prerequisites_policy follow cpan> o conf commit • cpan> install Params::Validate 2012
  • 15. got an example plugin template? • Use check_stuff.pl from the Nagios::Plugin distribution as your template. goo.gl/vpBnh • This is always a good place to start a plugin. • We’re going to be turning check_stuff.pl into the finished check_backup.pl example. 2012
  • 16. got the finished example? Published with Gist: https://gist.github.com/1218081 or goo.gl/hXnSm • Note the “raw” hyperlink for downloading the Perl source code. • The roman numerals in the comments match the next series of slides. 2012
  • 17. Check your setup 1. Save check_stuff.pl (goo.gl/vpBnh) as e.g. my_check_backup.pl. 2. Change the first “shebang” line to point to the Perl executable on your machine. #!c:/strawberry/bin/perl 3. Run it ./my_check_backup.pl 4. You should get: MY_CHECK_BACKUP UNKNOWN - you didn't supply a threshold argument 5. If yours works, help your neighbors. 2012
  • 18. Design: Which arguments do we need? • File name • Age in hours • Size in MB 2012
  • 19. Design: Thresholds • Non-existence: CRITICAL • Age problem: CRITICAL if over age threshold • Size problem: WARNING if outside size threshold (min:max) 2012
  • 20. I. Prologue (working from check_stuff.pl) use strict; use warnings; use Nagios::Plugin; use File::stat; use vars qw($VERSION $PROGNAME $verbose $timeout $result); $VERSION = '1.0'; # get the base name of this script for use in the examples use File::Basename; $PROGNAME = basename($0); 2012
  • 21. II. Usage/Help Changes from check_stuff.pl in bold my $p = Nagios::Plugin->new( usage => "Usage: %s [ -v|--verbose ] [-t <timeout>] [ -f|--file=<path/to/backup/file> ] [ -a|--age=<max age in hours> ] [ -s|--size=<acceptable min:max size in MB> ]", version => $VERSION, blurb => "Check the specified backup file's age and size", extra => " Examples: $PROGNAME -f /backups/foo.tgz -a 24 -s 1024:2048 Check that foo.tgz exists, is less than 24 hours old, and is between 1024 and 2048 MB. “); 2012
  • 22. III. Command line arguments/options Replace the 3 add_arg calls from check_stuff.pl with: # See Getopt::Long for more $p->add_arg( spec => 'file|f=s', required => 1, help => "-f, --file=STRING The backup file to check. REQUIRED."); $p->add_arg( spec => 'age|a=i', default => 24, help => "-a, --age=INTEGER Maximum age in hours. Default 24."); $p->add_arg( spec => 'size|s=s', help => "-s, --size=INTEGER:INTEGER Minimum:maximum acceptable size in MB (1,000,000 bytes)"); # Parse arguments and process standard ones (e.g. usage, help, version) $p->getopts; 2012
  • 23. Now it’s RTFM-enabled If you run it with no args, it shows usage: $ ./check_backup.pl Usage: check_backup.pl [ -v|--verbose ] [-t <timeout>] [ -f|--file=<path/to/backup/file> ] [ -a|--age=<max age in hours> ] [ -s|--size=<acceptable min:max size in MB> ] 2012
  • 24. Now it’s RTFM-enabled $ ./check_backup.pl --help check_backup.pl 1.0 This nagios plugin is free software, and comes with ABSOLUTELY NO WARRANTY. It may be used, redistributed and/or modified under the terms of the GNU General Public Licence (see http://www.fsf.org/licensing/licenses/gpl.txt). Check the specified backup file's age and size Usage: check_backup.pl [ -v|--verbose ] [-t <timeout>] [ -f|--file=<path/to/backup/file> ] [ -a|--age=<max age in hours> ] [ -s|--size=<acceptable min:max size in MB> ] -?, --usage Print usage information -h, --help Print detailed help screen -V, --version Print version information 2012
  • 25. Now it’s RTFM-enabled --extra-opts=[section][@file] Read options from an ini file. See http://nagiosplugins.org/extra-opts for usage and examples. -f, --file=STRING The backup file to check. REQUIRED. -a, --age=INTEGER Maximum age in hours. Default 24. -s, --size=INTEGER:INTEGER Minimum:maximum acceptable size in MB (1,000,000 bytes) -t, --timeout=INTEGER Seconds before plugin times out (default: 15) -v, --verbose Show details for command-line debugging (can repeat up to 3 times) Examples: check_backup.pl -f /backups/foo.tgz -a 24 -s 1024:2048 Check that foo.tgz exists, is less than 24 hours old, and is between 1024 and 2048 MB. 2012
  • 26. IV. Check arguments for sanity • Basic syntax checks already defined with add_arg, but replace the “sanity checking” with: # Perform sanity checking on command line options. if ( (defined $p->opts->age) && $p->opts->age < 0 ) { $p->nagios_die( " invalid number supplied for the age option " ); } • Your next plugin may be more complex. 2012
  • 27. Ooops At first I used -M, which Perl defines as “Script start time minus file modification time, in days.” Nagios uses embedded Perl by default so the “script start time” may be hours or days ago. 2012
  • 28. V. Check the stuff # Check the backup file. my $f = $p->opts->file; unless (-e $f) { $p->nagios_exit(CRITICAL, "File $f doesn't exist"); } my $mtime = File::stat::stat($f)->mtime; my $age_in_hours = (time - $mtime) / 60 / 60; my $size_in_mb = (-s $f) / 1_000_000; my $message = sprintf "Backup exists, %.0f hours old, %.1f MB.", $age_in_hours, $size_in_mb; 2012
  • 29. VI. Performance Data # Add perfdata, enabling pretty graphs etc. $p->add_perfdata( label => "age", value => $age_in_hours, uom => "hours" ); $p->add_perfdata( label => "size", value => $size_in_mb, uom => "MB" ); • This adds Nagios-friendly output like: | age=2.91611111111111hours;; size=0.515007MB;; 2012
  • 30. VII. Compare to thresholds Add this section. check_stuff.pl combines check_threshold with nagios_exit at the very end. # We already checked for file existence. my $result = $p->check_threshold( check => $age_in_hours, warning => undef, critical => $p->opts->age ); if ($result == OK) { $result = $p->check_threshold( check => $size_in_mb, warning => $p->opts->size, critical => undef, ); } 2012
  • 31. VIII. Exit Code # Output the result and exit. $p->nagios_exit( return_code => $result, message => $message ); 2012
  • 32. Testing the plugin $ ./check_backup.pl -f foo.gz BACKUP OK - Backup exists, 3 hours old, 0.5 MB | age=3.04916666666667hours;; size=0.515007MB;; $ ./check_backup.pl -f foo.gz -s 100:900 BACKUP WARNING - Backup exists, 23 hours old, 0.5 MB | age=23.4275hours;; size=0.515007MB;; $ ./check_backup.pl -f foo.gz -a 8 BACKUP CRITICAL - Backup exists, 23 hours old, 0.5 MB | age=23.4388888888889hours;; size=0.515007MB;; 2012
  • 33. Telling Nagios to use your plugin 1. misccommands.cfg* define command{ command_name check_backup command_line $USER1$/myplugins/check_backup.pl -f $ARG1$ -a $ARG2$ -s $ARG3$ } * Lines wrapped for slide presentation 2012
  • 34. Telling Nagios to use your plugin 2. services.cfg (wrapped) define service{ use generic-service normal_check_interval 1440 # 24 hours host_name fai01337 service_description MySQL backups check_command check_backup!/usr/local/backups /mysql/fai01337.mysql.dump.bz2 !24!0.5:100 contact_groups linux-admins } 3. Reload config: $ sudo /usr/bin/nagios -v /etc/nagios/nagios.cfg && sudo /etc/rc.d/init.d/nagios reload 2012
  • 35. Remote execution • Hosts/filesystems other than the Nagios host • Requirements • NRPE, NSClient or equivalent • Perl with Nagios::Plugin 2012
  • 36. Profit $ plugins/check_nt -H winhost -p 1248 -v RUNSCRIPT -l check_my_backup.bat OK - Backup exists, 12 hours old, 35.7 MB | age=12.4527777777778hours;; size=35.74016MB;; 2012
  • 38. Other tools and languages • C • TAP – Test Anything Protocol • See check_tap.pl from my other talk • Python • Shell • Ruby? C#? VB? JavaScript? • AutoIt! 2012
  • 39. Now in JavaScript Why JavaScript? • Node.js “Node's problem is that some of its users want to use it for everything? So what? “ • Cool kids • Crockford • “Always bet on JS” – Brendan Eich 2012
  • 40. Check_stuff.js – the short part var plugin_name = 'CHECK_STUFF'; // Set up command line args and usage etc using commander.js. var cli = require('commander'); cli .version('0.0.1') .option('-c, --critical <critical threshold>', 'Critical threshold using standard format', parseRangeString) .option('-w, --warning <warning threshold>', 'Warning threshold using standard format', parseRangeString) .option('-r, --result <Number4>', 'Use supplied value, not random', parseFloat) .parse(process.argv); 2012
  • 41. Check_stuff.js – the short part if (val == undefined) { val = Math.floor((Math.random() * 20) + 1); } var message = ' Sample result was ' + val.toString(); var perfdata = "'Val'="+val + ';' + cli.warning + ';' + cli.critical + ';'; if (cli.critical && cli.critical.check(val)) { nagios_exit(plugin_name, "CRITICAL", message, perfdata); } else if (cli.warning && cli.warning.check(val)) { nagios_exit(plugin_name, "WARNING", message, perfdata); } else { nagios_exit(plugin_name, "OK", message, perfdata); } 2012
  • 42. The rest • Range object • Range.toString() • Range.check() • Range.parseRangeString() • nagios_exit() Who’s going to make it an NPM module? 2012
  • 43. A silly but newfangled example Facebook friends is WARNING! ./check_facebook_friends.js -u nathan.vonnahme -w @202 -c @203 2012
  • 44. Check_facebook_friends.js See the code at gist.github.com/3760536 Note: functions as callbacks instead of loops or waiting... 2012
  • 45. A horrifying/inspiring example The worst things need the most monitoring. 2012
  • 46. Chart “servers” • MS Word macro • Mail merge • Runs in user session • Need about a dozen 2012
  • 47. It gets worse. • Not a service • Not even a process • 100% CPU is normal • “OK” is complicated. 2012
  • 49. AutoIt to the rescue Func CompareTitles() For $title=1 To $all_window_titles[0][0] Step 1 If $state=WinGetState($all_window_titles[$title][0]) StringRegExp($all_window_titles[$title][0], $vali $foo=0 d_windows[0])=1 Then $do_test=0 For $foo In $valid_states $expression=ControlGetText($all_window_titles[$ti If $state=$foo Then tle][0], "", 1013) $do_test +=1 EndIf EndIf EndIf Next Next If $all_window_titles[$title][0] <> "" AND $no_bad_windows=1 $do_test>0 Then EndFunc $window_is_valid=0 Func NagiosExit() For $string=0 To $num_of_strings-1 Step 1 ConsoleWrite($detailed_status) Exit($return) $match=StringRegExp($all_window_titles[$title][0] EndFunc , $valid_windows[$string]) $window_is_valid += $match CompareTitles() Next if $no_bad_windows=1 Then if $window_is_valid=0 Then $detailed_status="No chartserver anomalies at $return=2 this time -- " & $expression $detailed_status="Unexpected window *" & $return=0 $all_window_titles[$title][0] & "* present" & @LF EndIf & "***" & $all_window_titles[$title][0] & "*** doesn't match anything we expect." NagiosExit() NagiosExit() EndIf 2012
  • 50. Nagios now knows when they’re broken 2012
  • 51. Life is complicated “OK” is complicated. Custom plugins make Nagios much smarter about your environment. 2012
  • 52. Questions? Comments? Perl and JS plugin example code at gist.github.com/n8v 2012

Notas del editor

  1. Cf Mike Weber’s presentation:perl plugins can be more of a performance load
  2. Max 5 minute wait here. Again, we may not have time to troubleshoot your CPAN configuration right now. If you can&apos;t get it to work immediately, just watch or look on with someone else, or use another language. Unix people, you may want to help or observe someone with Windows because you&apos;ll want to do it too eventually.This worked like a dream for me with fresh Strawberry Perl, after I got the proxy configured.
  3. Again, replacing the section in check_stuff.pl
  4. This isn’t in check_stuff.pl
  5.  This is not working for me in production anymore.