[nagiosplug] check_dbi: Added some examples to the help output.

"Nagios Plugin Development" <[email protected]> Wed, 4 Jul 2012 22:10:48 +0000
Newsgroups gmane.network.nagios.plugins.cvs
Message-ID <[email protected]>
 Module: nagiosplug
 Branch: master
 Commit: eda2fe7f40810a03e1c9c32701916387fdf86165
 Author: Sebastian Harl <[email protected]>
   Date: Fri Apr 15 15:02:48 2011 +0200
    URL: http://nagiosplug.git.sf.net/git/gitweb.cgi?p=nagiosplug/nagiosplug;a=commit;h=eda2fe7

check_dbi: Added some examples to the help output.

---

 plugins/check_dbi.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/plugins/check_dbi.c b/plugins/check_dbi.c
index 4a0a4d6..eefcf02 100644
--- a/plugins/check_dbi.c
+++ b/plugins/check_dbi.c
@@ -455,7 +455,22 @@ print_help (void)
 
 	printf (" %s\n", _("The number and type of required DBI driver options depends on the actual"));
 	printf (" %s\n", _("driver. See its documentation at http://libdbi-drivers.sourceforge.net/"));
-	printf (" %s\n", _("for details."));
+	printf (" %s\n\n", _("for details."));
+
+	printf (" %s\n", _("Examples:"));
+	printf ("  check_dbi -d pgsql -o username=postgres -m QUERY_RESULT \\\n");
+	printf ("    -q 'SELECT COUNT(*) FROM pg_stat_activity' -w 5 -c 10\n");
+	printf ("  Warning if more than five connections; critical if more than ten.\n\n");
+
+	printf ("  check_dbi -d mysql -H localhost -o username=user -o password=secret \\\n");
+	printf ("    -q 'SELECT COUNT(*) FROM logged_in_users -w 5:20 -c 0:50\n");
+	printf ("  Warning if less than 5 or more than 20 users are logged in; critical\n");
+	printf ("  if more than 50 users.\n\n");
+
+	printf ("  check_dbi -d firebird -o username=user -o password=secret -o dbname=foo \\\n");
+	printf ("    -m CONN_TIME -w 0.5 -c 2\n");
+	printf ("  Warning if connecting to the database takes more than half of a second;\n");
+	printf ("  critical if it takes more than 2 seconds.\n");
 
 	printf (UT_SUPPORT);
 }


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/