SlideShare a Scribd company logo
1 of 30
Developing Nagios XI
Components and Wizards
Jake Omann
Developer @ Nagios
jomann@nagios.com
2
Components & Wizards
A component can add functionality
Can access internal/external versions of API
A config wizard is supposed to make life easy
Many allow for auto-completion
Step-by-step process
3
Components & Wizards: Links to Docs
Component Development and API
http://assets.nagios.com/downloads/nagiosxi/docs/XI_Component_Development.pdf
Config Wizard Development
http://assets.nagios.com/downloads/nagiosxi/docs/Writing_Custom_Wizards_In_XI.pdf
Example Component & Wizard
There is an example component linked inside
each of the above pdf documents
4
Components
A basic component consists of optional parts
Config settings
Display page(s)
Callbacks
Some components only include a config section
Global Event Handlers
Allows user to set up events to be ran when an
action happens – there's no actual display page
except the config settings
A majority of components have a display page
that lets you interact with it
5
Components: Directory Structure
Component file system basics:
componentname/
componentname.inc.php
componentname.php
Images should be added into an images folder
in component directory
Included files, scripts, libraries should be added
into an include or lib folder inside your
component directory
Example: BirdsEye 3
6
Components: Init function
Must define an init function
Controls information about the component and
runs the component registration, sets up the
main component config function, and registers
callbacks
7
Components: Example Code - Initialization
8
Components: Config Settings
Creating a settings button next to the installed
component with config settings
COMPONENT_CONFIGFUNCTION defines
the config function to be used
Inside the function you've created for the
component is a switch with two cases:
COMPONENT_CONFIGMODE_GETSETTINGSHTML
COMPONENT_CONFIGMODE_SAVESETTINGS
9
Components: Register Callbacks
Inside the init function defined by you
register_callback(CALLBACK_NAME,
'compname_func_do_stuff');
The first variable, CALLBACK_NAME must be a
valid XI callback – some helpful ones are
shown later
The second variable is the name of the function
we want to run
function compname_func_do_stuff($cbtype,&$cbargs)
Can use grab_array_var – ex:
$service = grab_array_var($cbargs, 'service');
10
Components: Register Callbacks Example
Example of:
Menu item callback
Host/service action button
Host/service tab
11
Components: Add Quick Actions & Tabs
Quick action buttons
CALLBACK_HOST_DETAIL_ACTION_LINK
CALLBACK_SERVICE_DETAIL_ACTION_LINK
Tabs
CALLBACK_HOST_TABS_INIT
CALLBACK_SERVICE_TABS_INIT
12
Components: Creating a QA
Adding an item to the $cbargs['actions'] will
display that item in the QA section
This is an example of adding a popup window
13
Components: Creating a Tab
$content is a string of HTML
$newtab is an array of id, title, and content
which will be displayed on the page
Adding to $cbdata[“tabs”] creates a new tab
14
Components: Add a Display Page
Menu item
CALLBACK_MENUS_INITIALIZED
Adds a menu item that will take the user to the location we
want them to go, normally the non .inc.php file included
with the component
15
Config Wizards
Guidelines
Free from FATAL, SYNTAX, and NOTICE messages
Never run UPDATE or INSERT SQL query on nagios or
nagiosql databases
Avoid using $_POST, $_GET, $_GLOBALS since the
post variables are already located in $inargs
Use grab_array_var instead
$form_var = grab_array_var($inargs, $varname,
'default value')
Most newer wizards store data being passed between
steps inside session arrays instead of the old way of
passing using serialized arrays
16
Config Wizards: Directory Structure
Much larger structure than a basic component –
needs quite a few required files
Directory structure:
mongodb_server
logos/mongodb.png
plugins/check_mongodb.py
templates/mongodb_server.cfg
config.xml
install.sh (optional)
mongodb_server.inc.php
17
Config Wizards: Templates
Templates are required to add the command
the wizard will be using to Nagios
mongodb_server.cfg
18
Config Wizards: Config XML
config.xml has three nodes plugins, templates, logos
<plugins> - you have to add any plugins
<templates> - you need to add any commands here
<logos> (optional) - logo that is in your logos folder
19
Config Wizards: Example Code - Initialization
20
Config Wizards: Example Code – The Function
● This function was defined in the init function
● Everything from the switch statement up must be included
and edited for your config wizard
21
Config Wizards: Stages
Has a set of “steps” in Nagios XI and “stages”
in the code
Note: Config wizards start on step 2, step 2-4
are editable inside a config wizard's code
Steps are not Stages... step #n = stage #n-1
Inside the switch statement we have each step
of the config wizard
CONFIGWIZARD_MODE_GETSTAGE1HTML
(stage 1) in your config wizard code is actually
step 2 when using a config wizard
22
Config Wizards: Stage 1
Each stage has 2 sections, html and validate
CONFIGWIZARD_MODE_GETSTAGE1HTML
CONFIGWIZARD_MODE_VALIDATESTAGE1DATA
To return to a stage during validation:
$result is the return 0 = ok, 1 = error
This stage is for gathering information about the
host/service you want to configure
23
Config Wizards: Stage 1
Stage 1 running in Nagios XI
24
Config Wizards: Stage 2
CONFIGWIZARD_MODE_GETSTAGE2HTML
CONFIGWIZARD_MODE_VALIDATESTAGE2DATA
Stage 2 allows you to select what you want to
monitor and how you want to monitor it
Some wizards will auto-populate the
information in stage 2 by contacting the host
Note: Clicking forward OR back should save
data from this stage and all others – be sure to
pass data along data using a session
25
Config Wizards: Stage 2
26
Config Wizards: Stage 3 and Final
CONFIGWIZARD_MODE_GETSTAGE2HTML
CONFIGWIZARD_MODE_VALIDATESTAGE2DATA
Stage 3 is already populated with monitoring settings
you cannot change in the wizard
Stage 3 is mostly used for saving data and passing it
on to be used
CONFIGWIZARD_MODE_GETFINALSTAGEHTML
The Final stage is the same – you will have to
continue passing the data if required (not using
session method of passing data)
Example: MySQL Server Wizard
27
Config Wizards: Get Objects
The final case in the config wizard switch
statement that will be ran
CONFIGWIZARD_MODE_GETOBJECTS
28
Config Wizards: Get Objects
"check_command" =>
"check_mongodb_server!connect!$port!$warning!$critical!$username!$password”
29
Config Wizards: Get Objects
Before breaking out of this section, add the
objects to the outargs
Will set up your commands in the Nagios config
for you after this stage
30
Examples & Tips
Example/base wizards and components can be
downloaded via links in the corresponding
developer help docs
Tip: Check out the source of some of the
wizards and components that you use (except
the protected Nagios XI ones) to get more of a
feel for how they work

More Related Content

Similar to Nagios Conference 2013 - Jake Omann - Developing Nagios XI Components and Wizards

Introduction to Mangento
Introduction to Mangento Introduction to Mangento
Introduction to Mangento Ravi Mehrotra
 
Working With The Symfony Admin Generator
Working With The Symfony Admin GeneratorWorking With The Symfony Admin Generator
Working With The Symfony Admin GeneratorJohn Cleveley
 
Parallelminds.web partdemo
Parallelminds.web partdemoParallelminds.web partdemo
Parallelminds.web partdemoManishaChothe
 
Angular performance slides
Angular performance slidesAngular performance slides
Angular performance slidesDavid Barreto
 
Customizing oro crm webinar
Customizing oro crm webinarCustomizing oro crm webinar
Customizing oro crm webinarOro Inc.
 
Architecture and Analytical Study of Magento
Architecture and Analytical Study of MagentoArchitecture and Analytical Study of Magento
Architecture and Analytical Study of MagentoIRJET Journal
 
Mageguru - magento custom module development
Mageguru -  magento custom module development Mageguru -  magento custom module development
Mageguru - magento custom module development Mage Guru
 
Aggregate persistence wizard
Aggregate persistence wizardAggregate persistence wizard
Aggregate persistence wizardreturnasap
 
05 b 01workflowcustomizing
05 b 01workflowcustomizing05 b 01workflowcustomizing
05 b 01workflowcustomizingtflung
 
Introduction to Integration Tests in Magento / Adobe Commerce
Introduction to Integration Tests in Magento / Adobe CommerceIntroduction to Integration Tests in Magento / Adobe Commerce
Introduction to Integration Tests in Magento / Adobe CommerceBartosz Górski
 
Introduction to Integration Tests in Magento / Adobe Commerce
Introduction to Integration Tests in Magento / Adobe CommerceIntroduction to Integration Tests in Magento / Adobe Commerce
Introduction to Integration Tests in Magento / Adobe CommerceBartosz Górski
 
Empowering users: modifying the admin experience
Empowering users: modifying the admin experienceEmpowering users: modifying the admin experience
Empowering users: modifying the admin experienceBeth Soderberg
 
Sap solution manager change request management
Sap solution manager change request managementSap solution manager change request management
Sap solution manager change request managementdryday sunny
 

Similar to Nagios Conference 2013 - Jake Omann - Developing Nagios XI Components and Wizards (20)

Mangento
MangentoMangento
Mangento
 
Introduction to Mangento
Introduction to Mangento Introduction to Mangento
Introduction to Mangento
 
Hats tutorial custom widget
Hats tutorial   custom widgetHats tutorial   custom widget
Hats tutorial custom widget
 
Working With The Symfony Admin Generator
Working With The Symfony Admin GeneratorWorking With The Symfony Admin Generator
Working With The Symfony Admin Generator
 
Parallelminds.web partdemo
Parallelminds.web partdemoParallelminds.web partdemo
Parallelminds.web partdemo
 
Backbone.js
Backbone.jsBackbone.js
Backbone.js
 
Angular performance slides
Angular performance slidesAngular performance slides
Angular performance slides
 
Customizing oro crm webinar
Customizing oro crm webinarCustomizing oro crm webinar
Customizing oro crm webinar
 
Magento++
Magento++Magento++
Magento++
 
Architecture and Analytical Study of Magento
Architecture and Analytical Study of MagentoArchitecture and Analytical Study of Magento
Architecture and Analytical Study of Magento
 
Mageguru - magento custom module development
Mageguru -  magento custom module development Mageguru -  magento custom module development
Mageguru - magento custom module development
 
Readme
ReadmeReadme
Readme
 
Aggregate persistence wizard
Aggregate persistence wizardAggregate persistence wizard
Aggregate persistence wizard
 
Test
TestTest
Test
 
05 b 01workflowcustomizing
05 b 01workflowcustomizing05 b 01workflowcustomizing
05 b 01workflowcustomizing
 
Introduction to Integration Tests in Magento / Adobe Commerce
Introduction to Integration Tests in Magento / Adobe CommerceIntroduction to Integration Tests in Magento / Adobe Commerce
Introduction to Integration Tests in Magento / Adobe Commerce
 
Introduction to Integration Tests in Magento / Adobe Commerce
Introduction to Integration Tests in Magento / Adobe CommerceIntroduction to Integration Tests in Magento / Adobe Commerce
Introduction to Integration Tests in Magento / Adobe Commerce
 
Empowering users: modifying the admin experience
Empowering users: modifying the admin experienceEmpowering users: modifying the admin experience
Empowering users: modifying the admin experience
 
Sap solution manager change request management
Sap solution manager change request managementSap solution manager change request management
Sap solution manager change request management
 
12 Amazing Features of Magento 2
12 Amazing Features of Magento 212 Amazing Features of Magento 2
12 Amazing Features of Magento 2
 

More from Nagios

Nagios XI Best Practices
Nagios XI Best PracticesNagios XI Best Practices
Nagios XI Best PracticesNagios
 
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
 
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
 
Janice Singh - Writing Custom Nagios Plugins
Janice Singh - Writing Custom Nagios PluginsJanice Singh - Writing Custom Nagios Plugins
Janice Singh - Writing Custom Nagios PluginsNagios
 
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
 

More from Nagios (20)

Nagios XI Best Practices
Nagios XI Best PracticesNagios XI Best Practices
Nagios XI Best Practices
 
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
 
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
 
Janice Singh - Writing Custom Nagios Plugins
Janice Singh - Writing Custom Nagios PluginsJanice Singh - Writing Custom Nagios Plugins
Janice Singh - Writing Custom Nagios Plugins
 
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
 

Recently uploaded

DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
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
 
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
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
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
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 

Recently uploaded (20)

DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
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
 
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
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
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
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
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
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 

Nagios Conference 2013 - Jake Omann - Developing Nagios XI Components and Wizards

  • 1. Developing Nagios XI Components and Wizards Jake Omann Developer @ Nagios jomann@nagios.com
  • 2. 2 Components & Wizards A component can add functionality Can access internal/external versions of API A config wizard is supposed to make life easy Many allow for auto-completion Step-by-step process
  • 3. 3 Components & Wizards: Links to Docs Component Development and API http://assets.nagios.com/downloads/nagiosxi/docs/XI_Component_Development.pdf Config Wizard Development http://assets.nagios.com/downloads/nagiosxi/docs/Writing_Custom_Wizards_In_XI.pdf Example Component & Wizard There is an example component linked inside each of the above pdf documents
  • 4. 4 Components A basic component consists of optional parts Config settings Display page(s) Callbacks Some components only include a config section Global Event Handlers Allows user to set up events to be ran when an action happens – there's no actual display page except the config settings A majority of components have a display page that lets you interact with it
  • 5. 5 Components: Directory Structure Component file system basics: componentname/ componentname.inc.php componentname.php Images should be added into an images folder in component directory Included files, scripts, libraries should be added into an include or lib folder inside your component directory Example: BirdsEye 3
  • 6. 6 Components: Init function Must define an init function Controls information about the component and runs the component registration, sets up the main component config function, and registers callbacks
  • 7. 7 Components: Example Code - Initialization
  • 8. 8 Components: Config Settings Creating a settings button next to the installed component with config settings COMPONENT_CONFIGFUNCTION defines the config function to be used Inside the function you've created for the component is a switch with two cases: COMPONENT_CONFIGMODE_GETSETTINGSHTML COMPONENT_CONFIGMODE_SAVESETTINGS
  • 9. 9 Components: Register Callbacks Inside the init function defined by you register_callback(CALLBACK_NAME, 'compname_func_do_stuff'); The first variable, CALLBACK_NAME must be a valid XI callback – some helpful ones are shown later The second variable is the name of the function we want to run function compname_func_do_stuff($cbtype,&$cbargs) Can use grab_array_var – ex: $service = grab_array_var($cbargs, 'service');
  • 10. 10 Components: Register Callbacks Example Example of: Menu item callback Host/service action button Host/service tab
  • 11. 11 Components: Add Quick Actions & Tabs Quick action buttons CALLBACK_HOST_DETAIL_ACTION_LINK CALLBACK_SERVICE_DETAIL_ACTION_LINK Tabs CALLBACK_HOST_TABS_INIT CALLBACK_SERVICE_TABS_INIT
  • 12. 12 Components: Creating a QA Adding an item to the $cbargs['actions'] will display that item in the QA section This is an example of adding a popup window
  • 13. 13 Components: Creating a Tab $content is a string of HTML $newtab is an array of id, title, and content which will be displayed on the page Adding to $cbdata[“tabs”] creates a new tab
  • 14. 14 Components: Add a Display Page Menu item CALLBACK_MENUS_INITIALIZED Adds a menu item that will take the user to the location we want them to go, normally the non .inc.php file included with the component
  • 15. 15 Config Wizards Guidelines Free from FATAL, SYNTAX, and NOTICE messages Never run UPDATE or INSERT SQL query on nagios or nagiosql databases Avoid using $_POST, $_GET, $_GLOBALS since the post variables are already located in $inargs Use grab_array_var instead $form_var = grab_array_var($inargs, $varname, 'default value') Most newer wizards store data being passed between steps inside session arrays instead of the old way of passing using serialized arrays
  • 16. 16 Config Wizards: Directory Structure Much larger structure than a basic component – needs quite a few required files Directory structure: mongodb_server logos/mongodb.png plugins/check_mongodb.py templates/mongodb_server.cfg config.xml install.sh (optional) mongodb_server.inc.php
  • 17. 17 Config Wizards: Templates Templates are required to add the command the wizard will be using to Nagios mongodb_server.cfg
  • 18. 18 Config Wizards: Config XML config.xml has three nodes plugins, templates, logos <plugins> - you have to add any plugins <templates> - you need to add any commands here <logos> (optional) - logo that is in your logos folder
  • 19. 19 Config Wizards: Example Code - Initialization
  • 20. 20 Config Wizards: Example Code – The Function ● This function was defined in the init function ● Everything from the switch statement up must be included and edited for your config wizard
  • 21. 21 Config Wizards: Stages Has a set of “steps” in Nagios XI and “stages” in the code Note: Config wizards start on step 2, step 2-4 are editable inside a config wizard's code Steps are not Stages... step #n = stage #n-1 Inside the switch statement we have each step of the config wizard CONFIGWIZARD_MODE_GETSTAGE1HTML (stage 1) in your config wizard code is actually step 2 when using a config wizard
  • 22. 22 Config Wizards: Stage 1 Each stage has 2 sections, html and validate CONFIGWIZARD_MODE_GETSTAGE1HTML CONFIGWIZARD_MODE_VALIDATESTAGE1DATA To return to a stage during validation: $result is the return 0 = ok, 1 = error This stage is for gathering information about the host/service you want to configure
  • 23. 23 Config Wizards: Stage 1 Stage 1 running in Nagios XI
  • 24. 24 Config Wizards: Stage 2 CONFIGWIZARD_MODE_GETSTAGE2HTML CONFIGWIZARD_MODE_VALIDATESTAGE2DATA Stage 2 allows you to select what you want to monitor and how you want to monitor it Some wizards will auto-populate the information in stage 2 by contacting the host Note: Clicking forward OR back should save data from this stage and all others – be sure to pass data along data using a session
  • 26. 26 Config Wizards: Stage 3 and Final CONFIGWIZARD_MODE_GETSTAGE2HTML CONFIGWIZARD_MODE_VALIDATESTAGE2DATA Stage 3 is already populated with monitoring settings you cannot change in the wizard Stage 3 is mostly used for saving data and passing it on to be used CONFIGWIZARD_MODE_GETFINALSTAGEHTML The Final stage is the same – you will have to continue passing the data if required (not using session method of passing data) Example: MySQL Server Wizard
  • 27. 27 Config Wizards: Get Objects The final case in the config wizard switch statement that will be ran CONFIGWIZARD_MODE_GETOBJECTS
  • 28. 28 Config Wizards: Get Objects "check_command" => "check_mongodb_server!connect!$port!$warning!$critical!$username!$password”
  • 29. 29 Config Wizards: Get Objects Before breaking out of this section, add the objects to the outargs Will set up your commands in the Nagios config for you after this stage
  • 30. 30 Examples & Tips Example/base wizards and components can be downloaded via links in the corresponding developer help docs Tip: Check out the source of some of the wizards and components that you use (except the protected Nagios XI ones) to get more of a feel for how they work