monitor your business
TRANSCRIPT
![Page 1: Monitor Your Business](https://reader035.vdocument.in/reader035/viewer/2022081403/554961c4b4c905f24e8b5a7c/html5/thumbnails/1.jpg)
Monitor your Business
Lars Jankowfsky, CTO, swoodoo GmbH
![Page 2: Monitor Your Business](https://reader035.vdocument.in/reader035/viewer/2022081403/554961c4b4c905f24e8b5a7c/html5/thumbnails/2.jpg)
Who is talking ?
Lars Jankowfsky:
- CTO swoodoo.com
- php since php/fi
- Developer since 15 years
Lars Jankowfsky, swoodoo.com
![Page 3: Monitor Your Business](https://reader035.vdocument.in/reader035/viewer/2022081403/554961c4b4c905f24e8b5a7c/html5/thumbnails/3.jpg)
Preface
- No rocket science today
- using existing widespread tools to create intelligent business monitoring
- nagios
- cacti
Lars Jankowfsky, swoodoo.com
![Page 4: Monitor Your Business](https://reader035.vdocument.in/reader035/viewer/2022081403/554961c4b4c905f24e8b5a7c/html5/thumbnails/4.jpg)
Nagios
- popular open source network monitoring software
- usually used mostly for networking/service monitoring ( load,ping,mysql...)
- http://www.nagios.org
- http://nagios.sourceforge.net/docs/3_0/quickstart-ubuntu.html
Lars Jankowfsky, swoodoo.com
- we will use it to modify some business values
![Page 5: Monitor Your Business](https://reader035.vdocument.in/reader035/viewer/2022081403/554961c4b4c905f24e8b5a7c/html5/thumbnails/5.jpg)
Nagios for business monitoring
- orders (eCommerce)
- imported data (webservices)
- customer activity (web 2.0)
- ...
Lars Jankowfsky, swoodoo.com
![Page 6: Monitor Your Business](https://reader035.vdocument.in/reader035/viewer/2022081403/554961c4b4c905f24e8b5a7c/html5/thumbnails/6.jpg)
Nagios - the script
Lars Jankowfsky, swoodoo.com
#!/usr/bin/php<?php
$value = rand(0,100);
if ($value < 50) { echo("VALUE WARNING - we got $value|v=$value"); exit(1);} else { echo("VALUE OK - we got $value|v=$value"); exit(0);}
Plugin Return Code: 0 OK 1 WARNING 2 CRITICAL 3 UNKNOWN
diff types - we use active (nagios calls)
passive checks write into nagios command file, and later nagios reads. Asynchronous
![Page 7: Monitor Your Business](https://reader035.vdocument.in/reader035/viewer/2022081403/554961c4b4c905f24e8b5a7c/html5/thumbnails/7.jpg)
Nagios - settings
Lars Jankowfsky, swoodoo.com
#TESTdefine command{ command_name check-php command_line $USER1$/check_php }
../etc/objects/commands.cfg
define service{ use local-service ; Name of service template to use host_name localhost service_description PHP check_command check-php }
../etc/objects/localhost.cfg
![Page 8: Monitor Your Business](https://reader035.vdocument.in/reader035/viewer/2022081403/554961c4b4c905f24e8b5a7c/html5/thumbnails/8.jpg)
Nagios - the result
Lars Jankowfsky, swoodoo.com
![Page 9: Monitor Your Business](https://reader035.vdocument.in/reader035/viewer/2022081403/554961c4b4c905f24e8b5a7c/html5/thumbnails/9.jpg)
cacti
- popular open source RRD graphing tool
- http://www.cacti.net
- apt-get install cacti
Lars Jankowfsky, swoodoo.com
![Page 10: Monitor Your Business](https://reader035.vdocument.in/reader035/viewer/2022081403/554961c4b4c905f24e8b5a7c/html5/thumbnails/10.jpg)
cacti - for business monitoring
- graphs for management e.g.
- orders, sales
- conversion rates
- booking/visitor rate
- import/sec. rate
- ...
Lars Jankowfsky, swoodoo.com
![Page 11: Monitor Your Business](https://reader035.vdocument.in/reader035/viewer/2022081403/554961c4b4c905f24e8b5a7c/html5/thumbnails/11.jpg)
cacti - the script
Lars Jankowfsky, swoodoo.com
very basic example...
#!/usr/bin/php<?php
// input in $argv
$a = rand(0,100);$b = rand(0,100);
echo("OK:$a ERR:$b");
/usr/local/share/cacti/scripts/test.php
![Page 12: Monitor Your Business](https://reader035.vdocument.in/reader035/viewer/2022081403/554961c4b4c905f24e8b5a7c/html5/thumbnails/12.jpg)
cacti - configuration
Lars Jankowfsky, swoodoo.com
#1 - create data input method
advice: add suffix ‘Data Input Method’.
![Page 13: Monitor Your Business](https://reader035.vdocument.in/reader035/viewer/2022081403/554961c4b4c905f24e8b5a7c/html5/thumbnails/13.jpg)
cacti - configuration
Lars Jankowfsky, swoodoo.com
#2 - add data input method fields
![Page 14: Monitor Your Business](https://reader035.vdocument.in/reader035/viewer/2022081403/554961c4b4c905f24e8b5a7c/html5/thumbnails/14.jpg)
cacti - configuration
Lars Jankowfsky, swoodoo.com
#3 - create data template
![Page 15: Monitor Your Business](https://reader035.vdocument.in/reader035/viewer/2022081403/554961c4b4c905f24e8b5a7c/html5/thumbnails/15.jpg)
cacti - configuration
Lars Jankowfsky, swoodoo.com
#4 - add data template fields
Maximum value 0 has special meaning. It means that threshold for maximum value.
be sure that everything is correct. No changes possible later!
![Page 16: Monitor Your Business](https://reader035.vdocument.in/reader035/viewer/2022081403/554961c4b4c905f24e8b5a7c/html5/thumbnails/16.jpg)
cacti - configuration
Lars Jankowfsky, swoodoo.com
#5 - create graph template...#6 - create graph template items
after that add type „legend“
![Page 17: Monitor Your Business](https://reader035.vdocument.in/reader035/viewer/2022081403/554961c4b4c905f24e8b5a7c/html5/thumbnails/17.jpg)
cacti - configuration
Lars Jankowfsky, swoodoo.com
#6 - create graph template items
![Page 18: Monitor Your Business](https://reader035.vdocument.in/reader035/viewer/2022081403/554961c4b4c905f24e8b5a7c/html5/thumbnails/18.jpg)
cacti - configuration
Lars Jankowfsky, swoodoo.com
#7 - create graph
make sure that everything is correct. You can‘t change contents later - need to recreate
![Page 19: Monitor Your Business](https://reader035.vdocument.in/reader035/viewer/2022081403/554961c4b4c905f24e8b5a7c/html5/thumbnails/19.jpg)
cacti - configuration
Lars Jankowfsky, swoodoo.com
#7 - add into tree
![Page 20: Monitor Your Business](https://reader035.vdocument.in/reader035/viewer/2022081403/554961c4b4c905f24e8b5a7c/html5/thumbnails/20.jpg)
cacti - that‘s it...
Lars Jankowfsky, swoodoo.com
![Page 21: Monitor Your Business](https://reader035.vdocument.in/reader035/viewer/2022081403/554961c4b4c905f24e8b5a7c/html5/thumbnails/21.jpg)
Talking about the php....
Lars Jankowfsky, swoodoo.com
- no reason to hack!
- use same source for cacti and nagios!
- don‘t forget the tests...
![Page 22: Monitor Your Business](https://reader035.vdocument.in/reader035/viewer/2022081403/554961c4b4c905f24e8b5a7c/html5/thumbnails/22.jpg)
Talking about the php....
Lars Jankowfsky, swoodoo.com
![Page 23: Monitor Your Business](https://reader035.vdocument.in/reader035/viewer/2022081403/554961c4b4c905f24e8b5a7c/html5/thumbnails/23.jpg)
Lars Jankowfsky, swoodoo.com
Questions?