setting up nagios monitoring in 20 min* - marklogic developer

26
Slide 1 Copyright © 2010 MarkLogic ® Corporation. All rights reserved. Slide 1 Copyright © 2011 MarkLogic ® Corporation. All rights reserved. Setting up Nagios monitoring in 20 min* Wolfgang Krause, Engineer, April 18th * Including the time for explanation Attention: MarkLogic and Nagios terminology collapses

Upload: others

Post on 09-Feb-2022

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Setting up Nagios monitoring in 20 min* - MarkLogic Developer

Slide 1 Copyright © 2010 MarkLogic® Corporation. All rights reserved. Slide 1 Copyright © 2011 MarkLogic® Corporation. All rights reserved.

Setting up Nagios monitoring in 20 min*

Wolfgang Krause, Engineer, April 18th

* Including the time for explanation

Attention: MarkLogic and Nagios terminology collapses

Page 2: Setting up Nagios monitoring in 20 min* - MarkLogic Developer

Slide 2 Copyright © 2010 MarkLogic® Corporation. All rights reserved. Slide 2 Copyright © 2011 MarkLogic® Corporation. All rights reserved.

Introduction What is this “box” doing?

Page 3: Setting up Nagios monitoring in 20 min* - MarkLogic Developer

Slide 3 Copyright © 2010 MarkLogic® Corporation. All rights reserved. Slide 3 Copyright © 2011 MarkLogic® Corporation. All rights reserved.

Disclaimer – Forward-looking Statements

All statements describing future releases and capabilities, estimated release dates, and content are plans only, and MarkLogic is under no obligation to develop, include or make available, commercially or otherwise, any specific feature or functionality in any MarkLogic product.   Information is provided for general understanding and informational purposes only, and is subject to change at the sole discretion of MarkLogic in response to changing customer requirements, market conditions, delivery schedules and other factors.

Information should not be distributed without written permission from MarkLogic.

Page 4: Setting up Nagios monitoring in 20 min* - MarkLogic Developer

Slide 4 Copyright © 2010 MarkLogic® Corporation. All rights reserved. Slide 4 Copyright © 2011 MarkLogic® Corporation. All rights reserved.

Agenda

§  Introduction § Monitoring Best Practices § Monitoring API § Nagios

§  Integration into Nagios overview § Demo

20min*

* we can chat about it after presentation

Page 5: Setting up Nagios monitoring in 20 min* - MarkLogic Developer

Slide 5 Copyright © 2010 MarkLogic® Corporation. All rights reserved. Slide 5 Copyright © 2011 MarkLogic® Corporation. All rights reserved.

Introduction – Monitoring Best Practices

§  MarkLogic specific metrics §  Device Space §  State

§  Loads §  Total-requests

§  …

Page 6: Setting up Nagios monitoring in 20 min* - MarkLogic Developer

Slide 6 Copyright © 2010 MarkLogic® Corporation. All rights reserved. Slide 6 Copyright © 2011 MarkLogic® Corporation. All rights reserved.

Introduction – Monitoring API

§  Imagine a Rest API in MarkLogic > 4.2 §  localhost:8003/manage/v1 §  localhost:8003/manage/v1/databases/Documents/status

§  localhost:8003/manage/v1/forests?host-id=myhost

Page 7: Setting up Nagios monitoring in 20 min* - MarkLogic Developer

Slide 7 Copyright © 2010 MarkLogic® Corporation. All rights reserved. Slide 7 Copyright © 2011 MarkLogic® Corporation. All rights reserved.

Integration into Nagios core

§  No agents required

Page 8: Setting up Nagios monitoring in 20 min* - MarkLogic Developer

Slide 8 Copyright © 2010 MarkLogic® Corporation. All rights reserved. Slide 8 Copyright © 2011 MarkLogic® Corporation. All rights reserved.

Introduction – Nagios

Red, yellow, green

Page 9: Setting up Nagios monitoring in 20 min* - MarkLogic Developer

Slide 9 Copyright © 2010 MarkLogic® Corporation. All rights reserved. Slide 9 Copyright © 2011 MarkLogic® Corporation. All rights reserved.

Integration into Nagios overview (custom)

§  Nagios-Package: §  You read the Readme & look at the documentation §  Copy MarkLogic Plugin

§  Generate your own Nagios config file based on your installation §  Copy config file

§  Restart Nagios

§  Done!

Page 10: Setting up Nagios monitoring in 20 min* - MarkLogic Developer

Slide 10 Copyright © 2010 MarkLogic® Corporation. All rights reserved. Slide 10 Copyright © 2011 MarkLogic® Corporation. All rights reserved.

Demo – ready for demo?

How are we with time?

Page 11: Setting up Nagios monitoring in 20 min* - MarkLogic Developer

Slide 11 Copyright © 2010 MarkLogic® Corporation. All rights reserved. Slide 11 Copyright © 2011 MarkLogic® Corporation. All rights reserved.

Demo - Step 1 the generation

perl generate_MarkLogic_config.pl!-a admin:admin !

-host e-node!

-port 8003 !

-clustername ML-Prod!

-u ML-Prod !

-filename ml_input_template.xml!

> MYNAGIOSCFG.cfg !

generate_MarkLogic_config.pl!

Page 12: Setting up Nagios monitoring in 20 min* - MarkLogic Developer

Slide 12 Copyright © 2010 MarkLogic® Corporation. All rights reserved. Slide 12 Copyright © 2011 MarkLogic® Corporation. All rights reserved.

Demo - Step 1 the generation

§  Retrieves: §  Name of Databases, Hosts, AppServers

§  (everything which is used in a XML input file)

§  Generates everything you “need” §  Grouping

§  Resources

§  Services

generate_MarkLogic_config.pl!

Page 13: Setting up Nagios monitoring in 20 min* - MarkLogic Developer

Slide 13 Copyright © 2010 MarkLogic® Corporation. All rights reserved. Slide 13 Copyright © 2011 MarkLogic® Corporation. All rights reserved.

Demo - Step 2 adding it

§  Add §  cfg_file=/usr/local/nagios/etc/objects/ml_generic.cfg!§  cfg_file=/usr/local/nagios/etc/objects/MYNAGIOSCFG.cfg*!

§  Into §  /usr/local/nagios/etc/nagios.cfg!

Page 14: Setting up Nagios monitoring in 20 min* - MarkLogic Developer

Slide 14 Copyright © 2010 MarkLogic® Corporation. All rights reserved. Slide 14 Copyright © 2011 MarkLogic® Corporation. All rights reserved.

Demo – Step 3 Test, Restart, Test

§  Test §  /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg!

§  Restart §  service nagios restart!

§  Test §  Play with it J

Page 15: Setting up Nagios monitoring in 20 min* - MarkLogic Developer

Slide 15 Copyright © 2010 MarkLogic® Corporation. All rights reserved. Slide 15 Copyright © 2011 MarkLogic® Corporation. All rights reserved.

Demo – Click through the UI

Page 16: Setting up Nagios monitoring in 20 min* - MarkLogic Developer

Slide 16 Copyright © 2010 MarkLogic® Corporation. All rights reserved. Slide 16 Copyright © 2011 MarkLogic® Corporation. All rights reserved.

Demo – Click through the UI

Page 17: Setting up Nagios monitoring in 20 min* - MarkLogic Developer

Slide 17 Copyright © 2010 MarkLogic® Corporation. All rights reserved. Slide 17 Copyright © 2011 MarkLogic® Corporation. All rights reserved.

Demo – Click through the UI

§  Resources: 1 Cluster: 2 Groups, 3 Hosts, 4 AppServers, 5 Databases

§  Services: #2 #3 #4 #5 #6

Page 18: Setting up Nagios monitoring in 20 min* - MarkLogic Developer

Slide 18 Copyright © 2010 MarkLogic® Corporation. All rights reserved. Slide 18 Copyright © 2011 MarkLogic® Corporation. All rights reserved.

Demo – Click through the UI

2) Explains the status Why is it green, yellow, red?!

Page 19: Setting up Nagios monitoring in 20 min* - MarkLogic Developer

Slide 19 Copyright © 2010 MarkLogic® Corporation. All rights reserved. Slide 19 Copyright © 2011 MarkLogic® Corporation. All rights reserved.

Conclusion Now I see what it is doing

Page 20: Setting up Nagios monitoring in 20 min* - MarkLogic Developer

Slide 20 Copyright © 2010 MarkLogic® Corporation. All rights reserved. Slide 20 Copyright © 2011 MarkLogic® Corporation. All rights reserved.

Questions/Feedback

www.marklogic.com [email protected]

Page 21: Setting up Nagios monitoring in 20 min* - MarkLogic Developer

Slide 21 Copyright © 2010 MarkLogic® Corporation. All rights reserved. Slide 21 Copyright © 2011 MarkLogic® Corporation. All rights reserved.

Which resources do you want to monitor?

ML-generic-host

ML-PROD-HOST

TaskServer

Documents

Wlan31.21.211

Cluster

5

4

2

Hostgroup/Cluster: ML-Cluster1 3

MyDB

MyOtherAppServer

MySecondHost

NagiosWorld = Host MLWorld = Resource

databases

appservers

hosts

cluster

1

1

1

1

Page 22: Setting up Nagios monitoring in 20 min* - MarkLogic Developer

Slide 22 Copyright © 2010 MarkLogic® Corporation. All rights reserved. Slide 22 Copyright © 2011 MarkLogic® Corporation. All rights reserved.

Simple Service Template

ML-generic-host

ML-PROD-HOST

TaskServer

Documents

Wlan31.21.211

request-rate

expanded-tree-cache-miss-rate

query-count

update-count

Cluster

ML-Prod-AppServerMetrics

ML-Prod-DatabaseMetrics

ML-Prod-Hosts

ML-Prod-General

1

2

4

6

Hostgroup: My-Cluster1 3

5

5

5

5

Metric-x

Metric-y

Metric-z

Page 23: Setting up Nagios monitoring in 20 min* - MarkLogic Developer

Slide 23 Copyright © 2010 MarkLogic® Corporation. All rights reserved. Slide 23 Copyright © 2011 MarkLogic® Corporation. All rights reserved.

A ML config file for Nagios (1)

§  1) Credentials for e-node

§  2) HostGroup = Cluster §  3) ServiceGroups for

§  AppServer

§  Databases §  Hosts

1

2

3

Page 24: Setting up Nagios monitoring in 20 min* - MarkLogic Developer

Slide 24 Copyright © 2010 MarkLogic® Corporation. All rights reserved. Slide 24 Copyright © 2011 MarkLogic® Corporation. All rights reserved.

A ML config file for Nagios (2)

§  1) Define resources/hosts for all: §  Databases §  AppServers

§  Hosts §  (Cluster) for idiots lights like

§  How many db are there

§  J

2

1

1

2

Page 25: Setting up Nagios monitoring in 20 min* - MarkLogic Developer

Slide 25 Copyright © 2010 MarkLogic® Corporation. All rights reserved. Slide 25 Copyright © 2011 MarkLogic® Corporation. All rights reserved.

A ML config file for Nagios (3)

§  A Nagios Service running against port 8003 §  Executes check_marklogic.pl

§  Construct an URL

§  Runs against a e-node

§  Can be used for multiple resources of the same type

§  Belongs to a service group §  …….….

check_marklogic.pl –a admin:admin –port 8003 –host wlan… –path /manage/servers –key server-uri –c 0:0

Page 26: Setting up Nagios monitoring in 20 min* - MarkLogic Developer

Slide 26 Copyright © 2010 MarkLogic® Corporation. All rights reserved. Slide 26 Copyright © 2011 MarkLogic® Corporation. All rights reserved.

Macro Explanation

A

B C

D E F F

G(eneric) host