Top Banner
monitoring Protocols
32
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: NSClient Workshop: 04 Protocols

monitoring

Protocols

Page 2: NSClient Workshop: 04 Protocols
Page 3: NSClient Workshop: 04 Protocols

Active Passive Realtime Future

Every x minute Every x minute Only on errors Only on errors

For each service For most services Only on errors Only on errors

Very chatty Very chatty Less chatty Not chatty

NRPE NRPE (ish)

NSCA NSCA

check_nt (ish)

NRDP

REST REST REST REST

NSCP NSCP NSCP NSCP

Page 4: NSClient Workshop: 04 Protocols
Page 5: NSClient Workshop: 04 Protocols

NRPEServer

Core

CheckSystem

CheckEventLog

CheckExternalScripts

check_foo.bat

QUERYNRPE

(1024)

QUERY

Port: 5666

allowed hosts

arguments

arguments

Page 6: NSClient Workshop: 04 Protocols

insecure=true

Page 7: NSClient Workshop: 04 Protocols
Page 8: NSClient Workshop: 04 Protocols

Configuring NRPE

Page 9: NSClient Workshop: 04 Protocols

3:1 Using NRPE

Page 10: NSClient Workshop: 04 Protocols

You know this one by now…

Enable NRPE

Run check_memory via NRPE

Page 11: NSClient Workshop: 04 Protocols

Enable NRPE

Run check_memory via NRPE

nscp help

nscp nrpe help

# Dont forget to (re)start NSClient++

Page 12: NSClient Workshop: 04 Protocols

Enable NRPE

Run check_memory via NRPE

nscp help

nscp nrpe help

# Dont forget to (re)start NSClient++

nscp nrpe --help

nscp nrpe install --help

Page 13: NSClient Workshop: 04 Protocols

Enable NRPE

Run check_memory via NRPE

nscp nrpe install --insecure true

--allowed-hosts 127.0.0.1 --arguments safe

check_nrpe --insecure --host 127.0.0.1

--command check_memory

Page 14: NSClient Workshop: 04 Protocols
Page 15: NSClient Workshop: 04 Protocols

Scheduler

Core

CheckSystem

CheckEventLog

CheckExternalScripts

check_foo.bat

QUERY

NSCA(512)

QUERY

Target: nsca

addressport

passwordencryptioncommands

intervalEtc…

NSCAClient

Notification

Page 16: NSClient Workshop: 04 Protocols
Page 17: NSClient Workshop: 04 Protocols

Using NSCA

Page 18: NSClient Workshop: 04 Protocols

3:2 Enable NSCA

Page 19: NSClient Workshop: 04 Protocols

Setup a check_cpu check every 5 seconds.

Send the result via NSCA to localhost:5667

No encryption, password=test

Page 20: NSClient Workshop: 04 Protocols

Setup a check_cpu check every 5 seconds.

Send the result via NSCA to localhost:5667

No encryption, password=test

Enable, Scheduler and NSCAClient

First add a schedule

Then configure default target

Page 21: NSClient Workshop: 04 Protocols

Setup a check_cpu check every 5 seconds.

Send the result via NSCA to localhost:5667

No encryption, password=test

Enable, Scheduler and NSCAClient

First add a schedule

/settings/scheduler/schedules

Then configure default target

/settings/NSCA/client/targets/default

Page 22: NSClient Workshop: 04 Protocols

Setup a check_cpu check every 5 seconds.

Send the result via NSCA to localhost:5667

No encryption, password=test

nscp test --settings nsca_server.ini

nscp test --settings nsca_client.ini

Page 23: NSClient Workshop: 04 Protocols
Page 24: NSClient Workshop: 04 Protocols

WEBServer

Core

CheckSystem

CheckEventLog

CheckExternalScripts

check_foo.bat

QUERYHTTP

QUERY

Port: 8443, 8080

allowed hosts

arguments

Page 25: NSClient Workshop: 04 Protocols

curl--insecure --header "password: PASSWORD“https://localhost:8443/query/QUERY?ARGS

curl--insecure --header "password: PASSWORD“https://localhost:8443/query/check_cpu?show-all

Page 26: NSClient Workshop: 04 Protocols

Using REST

Page 27: NSClient Workshop: 04 Protocols

3:3 Use REST

Page 28: NSClient Workshop: 04 Protocols

Curl can be found under: C:\nsclient\tools

Base URL is: https://localhost:8443/query/QUERY?ARGS

Check check_memory via REST

Whats the difference if you add show-all?

Page 29: NSClient Workshop: 04 Protocols

Check check_memory via REST

Whats the difference if you add show-all?

Curl can be found under: C:\nsclient\tools

Base URL is: https://localhost:8443/query/QUERY?ARGS

Enable web server and set the password (see previous lab)

Then use curl

Page 30: NSClient Workshop: 04 Protocols

Check check_memory via REST

Whats the difference if you add show-all?

Curl can be found under: C:\nsclient\tools

Base URL is: https://localhost:8443/query/QUERY?ARGS

Enable web server and set the password (see previous lab)

Then use curl

Don’t forget: --insecure, --header "password: PASSWORD“

Page 31: NSClient Workshop: 04 Protocols

Check check_memory via REST

Whats the difference if you add show-all?

Curl can be found under: C:\nsclient\tools

Base URL is: https://localhost:8443/query/QUERY?ARGS

curl --insecure --header "password: PASSWORD“

https://localhost:8443/query/check_memory?show-all

Page 32: NSClient Workshop: 04 Protocols