Kaynağa Gözat

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/.
Sebastian Harl 15 yıl önce
ebeveyn
işleme
a241ab0b9d
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      plugins/check_pgsql.c

+ 1 - 1
plugins/check_pgsql.c

@@ -321,7 +321,7 @@ process_arguments (int argc, char **argv)
 			query_warning = optarg;
 			query_warning = optarg;
 			break;
 			break;
 		case 'H':     /* host */
 		case 'H':     /* host */
-			if (!is_host (optarg))
+			if ((*optarg != '/') && (!is_host (optarg)))
 				usage2 (_("Invalid hostname/address"), optarg);
 				usage2 (_("Invalid hostname/address"), optarg);
 			else
 			else
 				pghost = optarg;
 				pghost = optarg;