[nagiosplug] check_pgsql: Allow UNIX socket directories as ...

Nagios Plugin Development nagios-plugins at users.sourceforge.net
Sat Aug 17 22:50:41 CEST 2013


 Module: nagiosplug
 Branch: master
 Commit: a241ab0b9de9aa1dca32745d8461d649c48b4cc2
 Author: Sebastian Harl <sh at teamix.net>
   Date: Thu Apr  7 11:13:49 2011 +0200
    URL: http://nagiosplug.git.sf.net/git/gitweb.cgi?p=nagiosplug/nagiosplug;a=commit;h=a241ab0

check_pgsql: Allow UNIX socket directories as hostname as well.

PostgreSQL accepts the directory name of its UNIX socket as hostname as well,
e.g. /var/run/postgresql/.

---

 plugins/check_pgsql.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c
index cf526a6..c20c991 100644
--- a/plugins/check_pgsql.c
+++ b/plugins/check_pgsql.c
@@ -321,7 +321,7 @@ process_arguments (int argc, char **argv)
 			query_warning = optarg;
 			break;
 		case 'H':     /* host */
-			if (!is_host (optarg))
+			if ((*optarg != '/') && (!is_host (optarg)))
 				usage2 (_("Invalid hostname/address"), optarg);
 			else
 				pghost = optarg;





More information about the Commits mailing list