Check MK Conference · k/treasures/ Treasure: find_piggy_orphans find_piggy_orphans ESX Data is...
Transcript of Check MK Conference · k/treasures/ Treasure: find_piggy_orphans find_piggy_orphans ESX Data is...
![Page 1: Check MK Conference · k/treasures/ Treasure: find_piggy_orphans find_piggy_orphans ESX Data is piggyback data Scripts uses livestatus query to verify vm’s not added into Check_MK.](https://reader033.fdocuments.us/reader033/viewer/2022051511/6015eb167cd0b971d54899ad/html5/thumbnails/1.jpg)
Tim DespiegelaereSystem EngineerLead Monitoring
Check_MK ConferenceTreasures
![Page 2: Check MK Conference · k/treasures/ Treasure: find_piggy_orphans find_piggy_orphans ESX Data is piggyback data Scripts uses livestatus query to verify vm’s not added into Check_MK.](https://reader033.fdocuments.us/reader033/viewer/2022051511/6015eb167cd0b971d54899ad/html5/thumbnails/2.jpg)
Who am I Treasures Demo Treasures Demo … Questions
Agenda
![Page 3: Check MK Conference · k/treasures/ Treasure: find_piggy_orphans find_piggy_orphans ESX Data is piggyback data Scripts uses livestatus query to verify vm’s not added into Check_MK.](https://reader033.fdocuments.us/reader033/viewer/2022051511/6015eb167cd0b971d54899ad/html5/thumbnails/3.jpg)
Tim Despiegelaere
• System Engineer @ Synergics• Lead monitoring• Since 2009
Who am I and what we do
![Page 4: Check MK Conference · k/treasures/ Treasure: find_piggy_orphans find_piggy_orphans ESX Data is piggyback data Scripts uses livestatus query to verify vm’s not added into Check_MK.](https://reader033.fdocuments.us/reader033/viewer/2022051511/6015eb167cd0b971d54899ad/html5/thumbnails/4.jpg)
Who am I and what we do
![Page 5: Check MK Conference · k/treasures/ Treasure: find_piggy_orphans find_piggy_orphans ESX Data is piggyback data Scripts uses livestatus query to verify vm’s not added into Check_MK.](https://reader033.fdocuments.us/reader033/viewer/2022051511/6015eb167cd0b971d54899ad/html5/thumbnails/5.jpg)
What are those treasures?
YOU
![Page 6: Check MK Conference · k/treasures/ Treasure: find_piggy_orphans find_piggy_orphans ESX Data is piggyback data Scripts uses livestatus query to verify vm’s not added into Check_MK.](https://reader033.fdocuments.us/reader033/viewer/2022051511/6015eb167cd0b971d54899ad/html5/thumbnails/6.jpg)
What are those treasures?
![Page 7: Check MK Conference · k/treasures/ Treasure: find_piggy_orphans find_piggy_orphans ESX Data is piggyback data Scripts uses livestatus query to verify vm’s not added into Check_MK.](https://reader033.fdocuments.us/reader033/viewer/2022051511/6015eb167cd0b971d54899ad/html5/thumbnails/7.jpg)
treasures
/opt/omd/versions/1.2.6p11.mk/share/doc/check_mk/treasures/
![Page 8: Check MK Conference · k/treasures/ Treasure: find_piggy_orphans find_piggy_orphans ESX Data is piggyback data Scripts uses livestatus query to verify vm’s not added into Check_MK.](https://reader033.fdocuments.us/reader033/viewer/2022051511/6015eb167cd0b971d54899ad/html5/thumbnails/8.jpg)
Treasure: find_piggy_orphans
find_piggy_orphans
ESX Data is piggyback data
Scripts uses livestatus query to verify vm’s not added into Check_MK
![Page 9: Check MK Conference · k/treasures/ Treasure: find_piggy_orphans find_piggy_orphans ESX Data is piggyback data Scripts uses livestatus query to verify vm’s not added into Check_MK.](https://reader033.fdocuments.us/reader033/viewer/2022051511/6015eb167cd0b971d54899ad/html5/thumbnails/9.jpg)
Treasure: find_piggy_orphans
./find_piggy_orphans
OMD[synergics]:$ ./find_piggy_orphans10.46.221.1510.46.221.1610.46.221.1710.46.221.1810.46.221.1910.46.221.3110.46.221.3210.46.221.3310.46.221.34apr024202pdcmcmsdiaagoaggdb1sdiaaitotdev1…
![Page 10: Check MK Conference · k/treasures/ Treasure: find_piggy_orphans find_piggy_orphans ESX Data is piggyback data Scripts uses livestatus query to verify vm’s not added into Check_MK.](https://reader033.fdocuments.us/reader033/viewer/2022051511/6015eb167cd0b971d54899ad/html5/thumbnails/10.jpg)
Treasure: downtime
./downtime
creating or removing downtimes
Requirement: automation user
6 modes, set & remove for: host, service(s), host + services
![Page 11: Check MK Conference · k/treasures/ Treasure: find_piggy_orphans find_piggy_orphans ESX Data is piggyback data Scripts uses livestatus query to verify vm’s not added into Check_MK.](https://reader033.fdocuments.us/reader033/viewer/2022051511/6015eb167cd0b971d54899ad/html5/thumbnails/11.jpg)
Treasure: downtime
./downtime
Usage: downtime [-r] [OPTIONS] HOST [SERVICE1] [SERVICE2...]
Set a downtime./downtime -v -d 10 -c "Check_MK Conference demo" -S DIWWGYFHXGUVLXJQAJKD sdtcsynomd1
Remove a downtime ./downtime -r -v -d 10 -S DIWWGYFHXGUVLXJQAJKD sdtcsynomd1
![Page 12: Check MK Conference · k/treasures/ Treasure: find_piggy_orphans find_piggy_orphans ESX Data is piggyback data Scripts uses livestatus query to verify vm’s not added into Check_MK.](https://reader033.fdocuments.us/reader033/viewer/2022051511/6015eb167cd0b971d54899ad/html5/thumbnails/12.jpg)
Treasure: livedump
./livedump
Must run Nagios core (remote can run CMC)
Dump configuration & status
Creates passive services
No obsess_over needed with ocsp commands
![Page 13: Check MK Conference · k/treasures/ Treasure: find_piggy_orphans find_piggy_orphans ESX Data is piggyback data Scripts uses livestatus query to verify vm’s not added into Check_MK.](https://reader033.fdocuments.us/reader033/viewer/2022051511/6015eb167cd0b971d54899ad/html5/thumbnails/13.jpg)
Treasure: cmk-delete-host
./cmk-delete-host
Delete host (internally using web API)
Also deletes config, data and restarts site
Requirement: automation user (set in script)
![Page 14: Check MK Conference · k/treasures/ Treasure: find_piggy_orphans find_piggy_orphans ESX Data is piggyback data Scripts uses livestatus query to verify vm’s not added into Check_MK.](https://reader033.fdocuments.us/reader033/viewer/2022051511/6015eb167cd0b971d54899ad/html5/thumbnails/14.jpg)
Treasure: agent_wrapper.php
./agent_wrapper.php
If extra ports to the agents are not allowed. (ex. 6556)
Can be placed on any webserver.
Contains 1 line… system("/usr/bin/check_mk_agent")
![Page 15: Check MK Conference · k/treasures/ Treasure: find_piggy_orphans find_piggy_orphans ESX Data is piggyback data Scripts uses livestatus query to verify vm’s not added into Check_MK.](https://reader033.fdocuments.us/reader033/viewer/2022051511/6015eb167cd0b971d54899ad/html5/thumbnails/15.jpg)
Treasure: cmk-plugin-statistics
./cmk-plugin-statistics
Uses livestatus query to count plugins used in your site
./cmk-plugin-statistics 443 check-mk-inventory 443 check-mk 356 check_mk_active-mkevents 294 check_mk-snmp_info 235 check_mk-uptime…
![Page 16: Check MK Conference · k/treasures/ Treasure: find_piggy_orphans find_piggy_orphans ESX Data is piggyback data Scripts uses livestatus query to verify vm’s not added into Check_MK.](https://reader033.fdocuments.us/reader033/viewer/2022051511/6015eb167cd0b971d54899ad/html5/thumbnails/16.jpg)
Treasure: modbus
./modbus
Mostly used in industrial environments and appliances.Does not work out of the box.
usage: agent_modbus <host ip> <host port> <address:#words(1 or 2):counter|gauge:name>example: agent_modbus 192.168.0.1 502 856:2:counter:active_energy
If you want to test Modbus, have a look at https://github.com/AndreySV/check_modbus as well
![Page 17: Check MK Conference · k/treasures/ Treasure: find_piggy_orphans find_piggy_orphans ESX Data is piggyback data Scripts uses livestatus query to verify vm’s not added into Check_MK.](https://reader033.fdocuments.us/reader033/viewer/2022051511/6015eb167cd0b971d54899ad/html5/thumbnails/17.jpg)
Treasure: check_curl
./check_curl
Just like check_http!
Main difference: check_curl supports proxy servers
Usage: check_proxy [-P PROXYUSER:PROXYPASSWORD PROXYURL] URL [ TEXT ]
![Page 18: Check MK Conference · k/treasures/ Treasure: find_piggy_orphans find_piggy_orphans ESX Data is piggyback data Scripts uses livestatus query to verify vm’s not added into Check_MK.](https://reader033.fdocuments.us/reader033/viewer/2022051511/6015eb167cd0b971d54899ad/html5/thumbnails/18.jpg)
Treasure: msexchange
./msexchange
Several Exchange counters MSExchange ADAccess Domain Controllers MSExchangeTransport Dumpster MSExchangeIS Mailbox MSExchange ActiveSync MSExchange RpcClientAccess MSExchange Database
![Page 19: Check MK Conference · k/treasures/ Treasure: find_piggy_orphans find_piggy_orphans ESX Data is piggyback data Scripts uses livestatus query to verify vm’s not added into Check_MK.](https://reader033.fdocuments.us/reader033/viewer/2022051511/6015eb167cd0b971d54899ad/html5/thumbnails/19.jpg)
Treasure: msexchange
./msexchange
Attention for “MSExchangeIS Mailbox”
counter: 66720=MSExchangeIS Mailbox not working
Don’t forget to copy the “winperf” files to the local checks directory
![Page 20: Check MK Conference · k/treasures/ Treasure: find_piggy_orphans find_piggy_orphans ESX Data is piggyback data Scripts uses livestatus query to verify vm’s not added into Check_MK.](https://reader033.fdocuments.us/reader033/viewer/2022051511/6015eb167cd0b971d54899ad/html5/thumbnails/20.jpg)
Treasure: get_rrd_cache_stats
./get_rrd_cache_stats
Get RRD statistics from a running site (from rrdcached)
Data received:
$ date; ./get_rrd_cache_statsSun Oct 11 18:56:00 CEST 2015UpdatesWritten : 2463548JournalBytes : 19599733060QueueLength : 0FlushesReceived : 14249JournalRotate : 34TreeDepth : 18UpdatesReceived : 150231349DataSetsWritten : 144189425TreeNodesNumber : 45134
Sun Oct 11 18:56:05 CEST 2015246358319600030679014249341815023362014419190545134
5 sec difference35297619 (= 290 KB)0000227124800
![Page 21: Check MK Conference · k/treasures/ Treasure: find_piggy_orphans find_piggy_orphans ESX Data is piggyback data Scripts uses livestatus query to verify vm’s not added into Check_MK.](https://reader033.fdocuments.us/reader033/viewer/2022051511/6015eb167cd0b971d54899ad/html5/thumbnails/21.jpg)
Treasure: check_fstab_mounts
./check_fstab_mounts
Local check for checking if everything is mounted that is on auto in fstab.
Just put it in “local” folder of check_mk_agent
![Page 22: Check MK Conference · k/treasures/ Treasure: find_piggy_orphans find_piggy_orphans ESX Data is piggyback data Scripts uses livestatus query to verify vm’s not added into Check_MK.](https://reader033.fdocuments.us/reader033/viewer/2022051511/6015eb167cd0b971d54899ad/html5/thumbnails/22.jpg)
Treasure: zombies
./zombies
Local check for checking if there are zombie processes
Just put it in “local” folder of check_mk_agent
![Page 23: Check MK Conference · k/treasures/ Treasure: find_piggy_orphans find_piggy_orphans ESX Data is piggyback data Scripts uses livestatus query to verify vm’s not added into Check_MK.](https://reader033.fdocuments.us/reader033/viewer/2022051511/6015eb167cd0b971d54899ad/html5/thumbnails/23.jpg)
Treasure: notifications
./notifications/*
Several scripts to notify using Mobilant
• German SMS gateway: http://www.mobilant.de/
MultiTech• Sending SMS using a own gateway/modem: http://
www.multitech.com/brands/multimodem-isms
Pushover• Android/iPhone app – http://pushover.net
SNMP trap• Sending snmp traps
![Page 24: Check MK Conference · k/treasures/ Treasure: find_piggy_orphans find_piggy_orphans ESX Data is piggyback data Scripts uses livestatus query to verify vm’s not added into Check_MK.](https://reader033.fdocuments.us/reader033/viewer/2022051511/6015eb167cd0b971d54899ad/html5/thumbnails/24.jpg)
Questions?
Questions