Presentation is loading. Please wait.

Presentation is loading. Please wait.

How to Monitor Ingres with Open Source Tools Mark Whalley, Ingres Europe Ltd.

Similar presentations


Presentation on theme: "How to Monitor Ingres with Open Source Tools Mark Whalley, Ingres Europe Ltd."— Presentation transcript:

1 How to Monitor Ingres with Open Source Tools Mark Whalley, Ingres Europe Ltd.

2 For information contact Product Management at This presentation contains forward-looking statements that are based on management’s expectations, estimates, projections and assumptions. Forward-looking statements are made pursuant to the safe harbor provisions of the Private Securities Litigation Reform Act of 1995, as amended. These statements are not guarantees of future performance or functionality and involve certain risks and uncertainties, which are difficult to predict. Therefore, actual future functionality, features, results and trends may differ materially from what is forecast in forward-looking statements due to a variety of factors. Slide 2 © 2010 Ingres Corporation

3 Agenda  Monitoring Ingres –Why Monitor –What to Monitor –When to Monitor –Tools for Monitoring  Ingres Support Appliance / Nagios –Architecture Overview –Plug-ins  Guide to Building a Custom Plug-in  Example Plug-in  Questions and Answers © 2010 Ingres CorporationSlide 3

4 © 2010 Ingres CorporationSlide 4 Monitoring Ingres

5 Why monitor  Pre-empt problems –To keep installations up and running 24x7 –Planned downtime  Trend analysis  Root cause analysis  The business expects it  Basis for performance tuning  Evidence for Service Level Agreements (SLA) –Auditing  Resource planning –Hardware growth –Archiving © 2010 Ingres CorporationSlide 5

6 What to Monitor  Ingres –Processes –Logs  Databases –Connectivity –Locking –Space utilisation  Applications –User access –Resource utilisation –Process state © 2010 Ingres CorporationSlide 6

7 What to Monitor  Hardware –CPU load –Swap space –Disk fragmentation  Network –Inaccessible server –Performance © 2010 Ingres CorporationSlide 7

8 When to Monitor  24 hours a day  7 days a week  52 weeks of the year © 2010 Ingres CorporationSlide 8

9 Closed Source Tools for Monitoring  CA Unicentre  HP OpenView  BMC Patrol  Others © 2010 Ingres CorporationSlide 9

10 Open Source Tools for Monitoring  Ingres utilities –ipm, logstat, lockstat, ima, log files, snmp,...  Operating system utilities –ps, top, sar, df,...  Ingres Support Appliance (ISA) / Nagios  Others © 2010 Ingres CorporationSlide 10

11 © 2010 Ingres CorporationSlide 11 Ingres Support Appliance / Nagios

12 Nagios  A Open Source monitoring application  GNU General Public License V3  Monitors –Hosts –Networks –Others  Monitor hub runs on Linux/Unix  Download from © 2010 Ingres CorporationSlide 12

13 Nagios Users  250,000 users worldwide  1,300 reference sites –Including: © 2010 Ingres CorporationSlide 13

14 Monitors  Host resources –Processor load –Disk usage –System logs –Others  Network services –SMTP, POP3, HTTP, NNTP, SNMP, FTP, SSH,...  Just about anything else, for example –Door access alarms –Light sensors © 2010 Ingres CorporationSlide 14

15 Nagios  Monitors via plug-ins  Using: –Nagios Remote Plug-in Executor (NRPE) –SSH © 2010 Ingres CorporationSlide 15

16 Interface  Notifications via – –Pager –SMS  Optional Web interface  Event handlers for proactive problem resolution © 2010 Ingres CorporationSlide 16

17 Monitoring Host (Nagios Hub) Nagios check_nrpe Config Files Data Files Nagios architecture © 2010 Ingres CorporationSlide 17 Remote (monitored) Host NRPE Local Services check_disk check_ingres check_cpu Hub Plug-in Nagios Remote Program Executor “check” scripts Nagios requests execution of a plugin and stored in Nagios data files Plug-in Exit status and messages returned to Nagios 0 = OK, 1 = Warning, 2 = Critical, 3 = Unknown

18 Off-the-shelf Plug-ins  ~140 supported by Nagios development team  ~1600 community contributions  Downloadable from –http://nagiosplugins.org/http://nagiosplugins.org/ –http://exchange.nagios.org/http://exchange.nagios.org/ © 2010 Ingres CorporationSlide 18

19 Custom Plug-ins  Simple scripts written in –Shell script –C++ –C# –Perl –Python –PHP –Ruby –Etc. © 2010 Ingres CorporationSlide 19

20 Custom Plug-ins for Ingres  To monitor server processes  For Error log mining  To measure DMF cache hit ratios  To identify –Tables in overflow –Long running queries © 2010 Ingres CorporationSlide 20

21 © 2010 Ingres CorporationSlide 21 Guide to Building a Custom Plug-in

22  Step 1 - Design  Step 2 - Develop  Step 3 - Test  Step 4 - Deploy  Step 5 - Execute  Step 6 - Contribute © 2010 Ingres CorporationSlide 22

23 Step 1 - Design  Check there is not a plug-in that already does this  Review development guidelines –http://nagiosplug.sourceforge.net/developer-guidelines.htmlhttp://nagiosplug.sourceforge.net/developer-guidelines.html  Define plug-in specification –May include: Triggers for exit codes Messages to be returned to Nagios Performance data for graphing Persistent data for loading into Ingres tables © 2010 Ingres CorporationSlide 23

24 Step 2 - Develop  Write plugin using preferred development tools  Use source code revision control –subversion –sccs  Locate scripts (or executables) in /usr/local/nagios/libexec © 2010 Ingres CorporationSlide 24

25 Step 3 - Test  For example: su - nagios cd /tmp /usr/local/nagios/libexec/check_isa_ingres _lrq_report -s /opt/IngresII –d demodb echo "Plugin Return Code: $?" © 2010 Ingres CorporationSlide 25

26 Step 4 - Deploy  For host(s) to be monitored –Copy plug-in into /usr/local/nagios/libexec © 2010 Ingres CorporationSlide 26

27 Step 4 - Deploy  Define plugin as a command within Nagios configuration file: /usr/local/nagios/etc/objects/commands.cfg © 2010 Ingres CorporationSlide 27 define command{ command_name check_remote_ingres_lrq_report command_line $USER1$/check_by_ssh -p $ARG1$ -l nagios –i /usr/local/nagios/etc/keys/$HOSTNAME$ -H $HOSTADDRESS$ -C /usr/local/nagios/libexec/check_isa_ingres_lrq_repor t -s $ARG2$ -d $ARG3$'}

28 Step 4 - Deploy  Place service definitions within Nagios configuration file: /usr/local/nagios/etc/objects/services.cfg © 2010 Ingres CorporationSlide 28 define service{ use remote-service host_name prod_svr service_description demodb – Long Running Queries check_command check_remote_ingres_lrq_report!22! /opt/IngresII!demodb}

29 Step 5 - Execute  Automatically by Nagios depending on –Time periods –Service checks enabled / disabled  Manually by user: –From a command line –From the Service Commands menu of the web interface © 2010 Ingres CorporationSlide 29

30 Step 6 - Contribute  Contributing plug-in to the community –http://exchange.nagios.org/http://exchange.nagios.org/ © 2010 Ingres CorporationSlide 30

31 © 2010 Ingres CorporationSlide 31 Example Plug-in

32 Long Running Queries Plug-in  Monitor plug-in –Generates a list of long running queries –Using ima  Report –A Nagios plug-in –Sends list of long running queries back to Nagios hub  Optional Ingres loader –Load list of long running queries into an Ingres table © 2010 Ingres CorporationSlide 32

33 Monitor Plug-in  Shell script (~2300 code lines)  Generates a list of long running queries  For a defined time period (e.g. 8 hours) –Do the following: Identify running queries using ima Record details of running queries Sleep © 2010 Ingres CorporationSlide 33

34 ima Query © 2010 Ingres CorporationSlide 34 /* Declare a GTT to store queries currently running against the database */ declare global temporary table session.ima_server_sessions as select session_id, effective_user, session_query from ima_server_sessions where session_query != '' and db_name = '${h_clv_database_name}' on commit preserve rows with norecovery \p\g

35 Report  Shell script (~600 lines of code)  Initiated by Nagios  Analyse and report on long running queries  Sends information back to Nagios Hub –OK No long running queries identified –Warning 1 or more queries took more than n seconds to run –Critical Unable to run monitor script © 2010 Ingres CorporationSlide 35

36 Optional Ingres loader  Not a requirement for Nagios to work –Provides persistence –Takes the list of long running queries –Loads it into an Ingres table –May be used for auditing / reporting  Shell script (~800 lines of code) © 2010 Ingres CorporationSlide 36

37 Service status details for all hosts screenshots © 2010 Ingres CorporationSlide 37 Dashboard: Summary of host and service status Service status and messages returned from plug-in

38 Service status for long running queries Status Information: WARNING - Installation: A9, Database: ltp, Pause: 1(sec), Run Time: 5(min). Last check started 06/05/ :03:21 and completed 06/05/ :08:25. 1 query was identified: User: ingres Query: select * from bw_boat_listing, bw_boat_listing, bw_boat_listing (seen 123 times) Status Information: WARNING - Installation: A9, Database: ltp, Pause: 1(sec), Run Time: 5(min). Last check started 06/05/ :03:21 and completed 06/05/ :08:25. 1 query was identified: User: ingres Query: select * from bw_boat_listing, bw_boat_listing, bw_boat_listing (seen 123 times)

39 Summary  Monitoring Ingres –Why Monitor –What to Monitor –When to Monitor –Tools for Monitoring  Ingres Support Appliance / Nagios –Architecture Overview –Plug-ins  Guide to Building a Custom Plug-in  Example Plug-in © 2010 Ingres CorporationSlide 39


Download ppt "How to Monitor Ingres with Open Source Tools Mark Whalley, Ingres Europe Ltd."

Similar presentations


Ads by Google