44
Group Deployment of Service Checks Mike Weber [email protected]

Mike Weber - Nagios and Group Deployment of Service Checks

  • Upload
    nagios

  • View
    452

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Mike Weber - Nagios and Group Deployment of Service Checks

Group Deployment ofService Checks

Mike Weber

[email protected]

Page 2: Mike Weber - Nagios and Group Deployment of Service Checks

2015 2

Large Scale Deployment Stress

Page 3: Mike Weber - Nagios and Group Deployment of Service Checks

2015 3

Goals: Rapid Deployment of Services

Cut Deployment Time by 50%Through accurate analysis and the use of scripts reduce the time needed to create an efficient design.

Increase Efficient Management by 75%Dramatically change the way service checks, templates and hosts are implemented and managed.

Page 4: Mike Weber - Nagios and Group Deployment of Service Checks

2015 4

Strategy Context

Page 5: Mike Weber - Nagios and Group Deployment of Service Checks

2015 5

Strategy: Analysis

Hardware / VirtualEvaluate the type of server you will be monitoring to implement SNMP for hardware and monitor the hosts for the virtual

environments.

Network Topology and FirewallsList the network infrastructure that will be monitored, the firewall

limitations and the data centers.

Host TypesThis analysis will also require the version of the OS as well as the

environment it will be running in like production, developement,

etc.

SettingsAnalyze each of the triggers for each service check required and

who will be included in the notification/escalation process.

Page 6: Mike Weber - Nagios and Group Deployment of Service Checks

2015 6

Strategy: Design

Network Requirements* firewalls* data centers

Host Requirements* What needs to be checked?

Service Check Requirements* triggers

* timing

Notification/Escalation Requirements* Who gets notfied and when.

Page 7: Mike Weber - Nagios and Group Deployment of Service Checks

2015 7

Strategy: Evaluation

Build a Test Environment* Simulate the real thing!

Build One Host for Each Type* Hammer them...verify everything.

Build Notification/Escalation* Do the work, implement as you go

Page 8: Mike Weber - Nagios and Group Deployment of Service Checks

2015 8

Want an easier path?

Page 9: Mike Weber - Nagios and Group Deployment of Service Checks

2015 9

Strategy: Rapid Deployment

Deploy Templates, Service Checks Structure, Notification

Deploy Hosts, Service Checks and Parents

Page 10: Mike Weber - Nagios and Group Deployment of Service Checks

2015 10

Strategy: Efficient Management

Create Leverage * Control Services From One Template* Plan for Exceptions

5 Piece Model* host

* host template (attached to host)* hostgroup (attached to host)

* service template (attach to hostgroup)

* services (attach to service template)

Page 11: Mike Weber - Nagios and Group Deployment of Service Checks

2015 11

Object Inheritance: Hostgroup

Page 12: Mike Weber - Nagios and Group Deployment of Service Checks

2015 12

Object Inheritance: Service Template

Page 13: Mike Weber - Nagios and Group Deployment of Service Checks

2015 13

Idea! --- Build a Script to Automate Install

Page 14: Mike Weber - Nagios and Group Deployment of Service Checks

2015 14

Principles for Service Check Group Deployment

Group Prepared ChecksCreate groups of checks that allow for rapid deployment of services needed. (CPU checks, Memory checks, etc.)

Efficient Management of Group ChecksUsing object inheritance create service templates and services.

Script DeploymentBuild scripts that will enable you to input data to create pre-created

templates and services.

Page 15: Mike Weber - Nagios and Group Deployment of Service Checks

2015 15

Script Functions

Deploy Selection of Group

Deploy Token and IP AddressThis process build useful service checks so you do not need to make modifications.

Deploy Skeleton Structure* hostgroup

* service template

* services* commands

* definitions

Page 16: Mike Weber - Nagios and Group Deployment of Service Checks

2015 16

Script

Bash Shell Scriptgroup_deploy.sh

Folderscheckscommands

defs hostgroups

service_templates

win_ncpa_activewin_ncpa_api

win_ncpa_passive.

Page 17: Mike Weber - Nagios and Group Deployment of Service Checks

2015 17

Strategy Context: Rapid Deployment

Page 18: Mike Weber - Nagios and Group Deployment of Service Checks

2015 18

Page 19: Mike Weber - Nagios and Group Deployment of Service Checks

2015 19

Group Prepared Checks

Windows* NCPA: Browser Access, API with Graphing, Passive* WMI

* NSClient++: NRPE, NT* Eventlog Filters

Linux* NRPE

* NCPA: Browser Access, API with Graphing, Plugins, Passive* NRDS

* NRDP* SNMP

Page 20: Mike Weber - Nagios and Group Deployment of Service Checks

2015 20

Focus: NCPA - Windows Performance Counters

NCPA: Performance Counter Definitions

NCPA: Browser Access to API

NCPA: Service Check with Graphing

NCPA: Passive Checks

Page 21: Mike Weber - Nagios and Group Deployment of Service Checks

2015 21

NCPA:Windows Perf Counter Definitions

Write Definitions Create definitions for each counter so users have some idea about what the

counter does.

Group DefinitionsCreate groups for definitions so the user can review relevant

information and options.

Access the Definitions from the Script

Page 22: Mike Weber - Nagios and Group Deployment of Service Checks

2015 22

Windows Perf Counter Definitions: Examples

Processor:% Processor TimeThis counter measures how much time the processor spends in productive time. The counter simply subtracts the percentage from

100%. So in the example “1” indicates it is only doing productive activities for 1% of the time. Note this check is for core “0”, for

additional cores change that number. If you wanted to check all

core use “*”.

TCPv4: Connection Failures This is the raw number of TCP connections that have failed since

the server was started. This will typically incur a loss of data so you should pay attention to this counter.

Page 23: Mike Weber - Nagios and Group Deployment of Service Checks

2015 23

Script Function: Definitions

Write Definitions for Each CounterCreate definitions for each counter so users have some idea about what the counter does.

Group DefinitionsCreate groups for definitions so the user can review relevant information and options.

Access the Definitions from the Script

Page 24: Mike Weber - Nagios and Group Deployment of Service Checks

2015 24

Windows Perf Counter Definitions: Script

Make the group selection you want to implement

1) --- Review Windows Performance Counter Definitions2) --- Select Windows NCPA Browser Access Options

3) --- Select Windows NCPA Active Options4) --- Select Windows NCPA Passive Optionsq) --- Quit

Please Type Your Selection:1cache_win_ncpa.txt process_win_ncpa.txt icmp_win_ncpa.txtjob_object_win_ncpa.txt ras_total_win_ncpa.txt memory_win_ncpa.txt server_win_ncpa.txtnet_adapter_win_ncpa.txt server_work_queue_win_ncpa.txt net_interface_win_ncpa.txt smtp_server_win_ncpa.objects_win_ncpa.txt system_win_ncpa.txt paging_win_ncpa.txt tcpv4_win_ncpa.txtphysical_disk_win_ncpa.txt tcp_win_ncpa.txt print_queue_win_ncpa.txt term_serviprocessor.txt thread_win_ncpa.txt processor_win_ncpa.txt

Which Windows Performance Counter definition would you like more information on?process_win_ncpa.txt

Process(*): % Processor TimeThis process performance counter represents the rate of used time in which the threads are used

Page 25: Mike Weber - Nagios and Group Deployment of Service Checks

2015 25

Browser API Access

API Checks with BrowserThe purpose of the script is to convert the desired group into usable checks to be

dropped into a browser.

Convert Links to ASCIIIn order for the links to work, they must be converted into ASCII.Your browser will encode input, according to the character-set used in your page. The default

character-set in HTML5 is UTF-8.

space %20

( %28

) %29 * %2A

/ %2F

: %3A

-

https://104.130.136.58:5693/api/windowscounters/Memory/Available%20Bytes?token=na

gios

Page 26: Mike Weber - Nagios and Group Deployment of Service Checks

2015 26

Script: API Access via a Browser

Make the group selection you want to implement

1) --- Review Windows Performance Counter Definitions2) --- Select Windows NCPA Browser Access Options

3) --- Select Windows NCPA Active Options4) --- Select Windows NCPA Passive Optionsq) --- Quit

Page 27: Mike Weber - Nagios and Group Deployment of Service Checks

2015 27

Access API Via the Browser: (488 checks)

ncpa_active_browser.cfg win_ncpa_api_paging_file.cfg win_ncpa_api_tcp_perform_diag.cfgwin_ncpa_api_cache.cfg win_ncpa_api_physdisk.cfg win_ncpa_api_telephwin_ncpa_api_dist_trans.cfg win_ncpa_api_print_queue.cfg win_ncpa_api_teredo_client.cfgwin_ncpa_api_dns64_global.cfg win_ncpa_api_process.cfg win_ncpa_api_teredo_relay.cfgwin_ncpa_api_http_service.cfg win_ncpa_api_processor.cfg win_ncpa_api_teredo_server.cfgwin_ncpa_api_iphttps.cfg win_ncpa_api_processor_info.cfg win_ncpa_api_terminal_services.cfgwin_ncpa_api_job_object.cfg win_ncpa_api_security_systemwide.cfg win_ncpa_api_thread.cfgwin_ncpa_api_logicaldisk.cfg win_ncpa_api_server.cfg win_ncpa_api_winsock.cfgwin_ncpa_api_memory.cfg win_ncpa_api_server_sessions.cfg win_ncpa_api_objects.cfg win_ncpa_api_system.cfg

Which group would you like to deploy?win_ncpa_api_memory.cfg

What is the IP Address of the host you want to view:104.130.136.58

What is your token for the host?nagios

https://104.130.136.58:5693/api/windowscounters/Memory/Available%20Bytes?token=nagioshttps://104.130.136.58:5693/api/windowscounters/Memory/Committed%20Bytes?token=nagios

Page 28: Mike Weber - Nagios and Group Deployment of Service Checks

2015 28

Access API Via the Browser: (copy / paste)

https://104.130.136.58:5693/api/windowscounters/Memory/Available%20Bytes?token=nagios

{"value": {"windowscounters": [

[1095032832.0

],"Available Bytes"

]}

}

Page 29: Mike Weber - Nagios and Group Deployment of Service Checks

2015 29

NCPA: Service Check with Graphing

Active Performance Counters40 Groups478 Service Checks

Built In Graphing

Automated Installationhostgroups

service templatescommands

services

Page 30: Mike Weber - Nagios and Group Deployment of Service Checks

2015 30

Script: Active Checks with Graphing (488 checks)

Make the group selection you want to implement

1) --- Review Windows Performance Counter Definitions2) --- Select Windows NCPA Browser Access Options

3) --- Select Windows NCPA Active Options4) --- Select Windows NCPA Passive Optionsq) --- Quit

Page 31: Mike Weber - Nagios and Group Deployment of Service Checks

2015 31

Access API Via the Browser: (478 checks)ncpa_perf_Cache.cfg ncpa_perf_Security_Per_Procesncpa_perf_Distributed_Transaction_Coordinator.cfg ncpa_perf_Security_System.cfg ncpa_perf_DNS64_Global.cfg ncpa_perf_Server.cfg ncpa_perf_HTTP_Service.cfg ncpa_perf_Server_Work_Queues.cfg ncpa_perf_ICMP.cfg ncpa_perf_System.cfg ncpa_perf_IPHTTPS_Global.cfg ncpa_perf_TCPIP_Performance.cfg ncpa_perf_IPv4.cfg ncpa_perf_TCPv4.cfg ncpa_perf_Job_Object.cfg ncpa_perf_Telephony.cfg ncpa_perf_Job_Object_Details.cfg ncpa_perf_Teredo_Client.cfg ncpa_perf_Logical_Disk.cfg ncpa_perf_Teredo_Relay.cfg ncpa_perf_Memory.cfg ncpa_perf_Teredo_Server.cfg ncpa_perf_Microsoft_Winsock.cfg ncpa_perf_Terminal_Services.cfg ncpa_perf_Network_Adapter.cfg ncpa_perf_Terminal_Services_Session.cfg ncpa_perf_Network_Interface.cfg ncpa_perf_Thread.cfg ncpa_perf_Objects.cfg ncpa_perf_UDPv4.cfg ncpa_perf_Paging_File.cfg ncpa_perf_Web_Service_Cachencpa_perf_Physical_Disk.cfg ncpa_perf_Web_Service_Cache_Kernel.cfgncpa_perf_Print_Queue.cfg ncpa_perf_Web_Service_Cachencpa_perf_Process.cfg ncpa_perf_Web_Service_.cfg ncpa_perf_Processor.cfg ncpa_perf_Web_Service.cfg ncpa_perf_processor_info.cfg

Which group would you like to deploy?win_ncpa_api_memory.cfgWhat is the IP Address of the host you want to view:104.130.136.58What is your token for the host?nagioshttps://104.130.136.58:5693/api/windowscounters/Memory/Available%20Bytes?token=nagios

Page 32: Mike Weber - Nagios and Group Deployment of Service Checks

2015 32

Active Checks with Graphing: (478 checks)

What services do you want to deploy?ncpa_perf_Cache.cfg

What is the token you are using for your hosts?nagios

What service template would you like to use?ncap_perf.cfg

Running pre-flight check on configuration data...Checking objects...Checking for circular paths...Checking global event handlers...Checking obsessive compulsive processor commands...Checking misc settings...Total Warnings: 0Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight checkRET: 0Running configuration check...Stopping nagios: done.Starting nagios: done.

Page 33: Mike Weber - Nagios and Group Deployment of Service Checks

2015 33

Deploy Hostgroup

Page 34: Mike Weber - Nagios and Group Deployment of Service Checks

2015 34

Deploy Services

Page 35: Mike Weber - Nagios and Group Deployment of Service Checks

2015 35

Deploy Service Template

Page 36: Mike Weber - Nagios and Group Deployment of Service Checks

2015 36

Deploy Service Template

Page 37: Mike Weber - Nagios and Group Deployment of Service Checks

2015 37

Deploy Service Template: Check Settings

Page 38: Mike Weber - Nagios and Group Deployment of Service Checks

2015 38

Deploy Service Template: Check Settings

Page 39: Mike Weber - Nagios and Group Deployment of Service Checks

2015 39

NCPA: Service Check with Graphing

Active Performance Counters40 Groups478 Service Checks

Built In Graphing

Automated Installationhostgroups

service templatescommands

services

Page 40: Mike Weber - Nagios and Group Deployment of Service Checks

2015 40

NCPA: Passive Service Checks

Passive Performance Counters40 Groups478 Service Checks

Copy / Paste

Page 41: Mike Weber - Nagios and Group Deployment of Service Checks

2015 41

Script: Passive Checks

Make the group selection you want to implement

1) --- Review Windows Performance Counter Definitions2) --- Select Windows NCPA Browser Access Options

3) --- Select Windows NCPA Active Options4) --- Select Windows NCPA Passive Optionsq) --- Quit

Page 42: Mike Weber - Nagios and Group Deployment of Service Checks

2015 42

Passive Service Check: (478 checks)

win_ncpa_pass_cache.txt win_ncpa_pass_net_interface.txt win_ncpa_pass_process.txtwin_ncpa_pass_memory.txt win_ncpa_pass_print_que.txt win_ncpa_pass_system.txtwin_ncpa_pass_net_adapter.txt win_ncpa_pass_processor.txt win_ncpa_pass_tcpv4.txt

What group would you like to use?win_ncpa_pass_objects.txt

What is the token you are using for your hosts?Nagios

%HOSTNAME%|Objects Threads = /api/windowscounters/Objects/Threads?token=nagios%HOSTNAME%|Objects Events = /api/windowscounters/Objects/Events?token=nagios%HOSTNAME%|Objects Mutexes = /api/windowscounters/Objects/Mutexes?token=nagios%HOSTNAME%|Objects Sections = /api/windowscounters/Objects/Sections?token=nagios

Page 43: Mike Weber - Nagios and Group Deployment of Service Checks

2015 43

You...and Large Scale Deployment Success

Page 44: Mike Weber - Nagios and Group Deployment of Service Checks

Questions

Send me an email if you would

like to try out the script:

[email protected]

Questions

Send me an email if you would

like to try out the script:

[email protected]