Code

check_pgsql: Allow UNIX socket directories as hostname as well.
authorSebastian Harl <sh@teamix.net>
Thu, 7 Apr 2011 09:13:49 +0000 (11:13 +0200)
committerSebastian Harl <sh@teamix.net>
Thu, 7 Apr 2011 09:13:49 +0000 (11:13 +0200)
PostgreSQL accepts the directory name of its UNIX socket as hostname as well,
e.g. /var/run/postgresql/.

plugins/check_pgsql.c

index b2e1876f1801605a4fafc2d28d415c2c940f932b..6251e0b21ed199f02639e8dedfbc0da69bbf0eec 100644 (file)
@@ -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;