• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Monitor Your Business V2
 

Monitor Your Business V2

on

  • 4,089 views

The most important thing happening in your website is the business process. So why should you monitor your database and your webserver only when your business is failing? Monitoring is not only about ...

The most important thing happening in your website is the business process. So why should you monitor your database and your webserver only when your business is failing? Monitoring is not only about hardware and databases - it's also about the internals of your application. Learn how to monitor your business using PHP and how to create nice, good looking management compatible graphs.

Statistics

Views

Total Views
4,089
Views on SlideShare
3,397
Embed Views
692

Actions

Likes
3
Downloads
55
Comments
0

8 Embeds 692

http://www.frontalaufprall.com 637
http://www.planet-php.net 40
http://planet-php.org 5
http://www.planet-php.org 4
http://www.slideshare.net 3
http://lj-toys.com 1
http://www.netvibes.com 1
http://www.covertbrowsing.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Monitor Your Business V2 Monitor Your Business V2 Presentation Transcript

    • Monitor your Business Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 Who is talking? Monitor your Business Lars Jankowfsky • CTO swoodoo.com • php since php/fi • developing since 15 years Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 Preface Monitor your Business • No rocket science today • using existing tools for business monitoring • nagios • cacti Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 What can you expect? Monitor your Business Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 What can you expect? Monitor your Business Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 What can you expect? Monitor your Business Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 nagios Monitor your Business nagios Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 nagios Monitor your Business • 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 Freitag, 20. März 2009
    • PHPCon Italia 2009 nagios Monitor your Business • orders (eCommerce) • imported data (webservices) • customer activity (web 2.0) •... Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 nagios Monitor your Business e.g. Order tracking • we use OXID CE • http://www.oxid-esales.com/download • could be any other shopping cart (osc,magento...) shop zeigen phpmyadmin zeigen Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 nagios Monitor your Business the script • /usr/local/nagios/libexec • php-cli • nagios active mode diff types - we use active (nagios calls) passive checks write into nagios command file, and later nagios reads. Asynchronous Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 nagios Monitor your Business Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 nagios Monitor your Business #!/usr/bin/php <?php $link = mysql_connect('localhost', 'root', 'root'); mysql_select_db('oxid', $link); $result = mysql_query(quot;SELECT count(*) FROM `oxorder` WHERE date(oxorderdate) = curdate()quot;); $row = mysql_fetch_array($result, MYSQL_NUM); $todayordercount = $row[0]; mysql_close($link); if ($todayordercount < 1) { echo(quot;VALUE ERROR - we got $todayordercount|v=$todayordercountquot;); exit(2); } elseif ($todayordercount < 5) { echo(quot;VALUE WARNING - we got $todayordercount|v=$todayordercountquot;); exit(1); } else { echo(quot;VALUE OK - we got $todayordercount|v=$todayordercountquot;); exit(0); } Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 nagios Monitor your Business Plugin Return Code: • 0=OK • 1=WARNING • 2=CRITICAL • 3=UNKNOWN Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 nagios Monitor your Business ../etc/objects/commands.cfg Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 nagios Monitor your Business ../etc/objects/commands.cfg #Shop Orders define command{ command_name check-oxid-orders command_line $USER1$/check_oxid_orders } Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 nagios Monitor your Business ../etc/objects/localhost.cfg Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 nagios Monitor your Business ../etc/objects/localhost.cfg define service{ use local-service host_name localhost service_description SHOP_ORDERS check_command check-oxid-orders } Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 nagios Monitor your Business Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 nagios Monitor your Business Why nagios ? • automatic alerts like SMS or eMail • nearly every provider uses it • can use SNMP for remote testing • easy to setup and to configure Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 cacti Monitor your Business cacti Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 cacti Monitor your Business • popular open source RRD graphing tool • RRD == Round Robin Database • http://www.cacti.net • apt-get install cacti Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 cacti Monitor your Business • graphs for management like: • orders, sales • conversion rates • booking/visitor rate • import/sec. rate • ... Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 cacti Monitor your Business e.g. Page Impression tracking • again OXID CE • take source from table ,oxlogs‘ shop zeigen phpmyadmin zeigen Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 cacti Monitor your Business /usr/local/share/cacti/scripts/test.php Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 cacti Monitor your Business /usr/local/share/cacti/scripts/test.php #!/usr/bin/php <?php $link = mysql_connect('localhost', 'root', 'root'); mysql_select_db('oxid', $link); $result = mysql_query(quot;SELECT count(*) FROM `oxlogs` WHERE UNIX_TIMESTAMP(oxtime) > (UNIX_TIMESTAMP() - 300)quot;); $row = mysql_fetch_array($result, MYSQL_NUM); $hitsPerFiveMinutes = $row[0]; mysql_close($link); // something else $b = rand(0,10); echo(quot;OK:$hitsPerFiveMinutes ERR:$bquot;); Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 cacti Monitor your Business is the script ok ? • amount of data... • RRD advantages Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 cacti Monitor your Business #1 - create data input method Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 cacti Monitor your Business #2 - add data input method fields Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 cacti Monitor your Business #3 - create data template Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 cacti Monitor your Business #3 - create data template Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 cacti Monitor your Business #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! Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 cacti Monitor your Business #5 - create graph template... #6 - create graph template items after that add type „legend“ Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 cacti Monitor your Business #6 - create graph template items Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 cacti Monitor your Business #7 - create graph Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 cacti Monitor your Business #7 - add into tree Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 cacti Monitor your Business et voila.... Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 TDD! Monitor your Business Talking about the php.... • no reason to hack! • use same source for cacti and nagios! • don‘t forget the tests... Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 TDD! Monitor your Business Talking about the php.... Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 That‘s it... Monitor your Business Questions ? Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009
    • PHPCon Italia 2009 That‘s it... Monitor your Business Thank you for your interest! http://joind.in/talk/view/237 Lars Jankowfsky, swoodoo.com Freitag, 20. März 2009