summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorStanley Hopcroft <stanleyhopcroft@users.sourceforge.net>2005-01-25 22:15:00 +0000
committerStanley Hopcroft <stanleyhopcroft@users.sourceforge.net>2005-01-25 22:15:00 +0000
commit3af1430c72be64a6f0ee2ba7c40b41eed2201340 (patch)
tree98216ca91ad9d59c1f53299379c86d4aba5860c8 /plugins
parent60780d270fd4ea626023209ae6b159040699f860 (diff)
downloadmonitoring-plugins-3af1430c72be64a6f0ee2ba7c40b41eed2201340.tar.gz
Display usage if no argv (Reuben Farrelly)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1106 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/check_ide_smart.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/plugins/check_ide_smart.c b/plugins/check_ide_smart.c
index b5021fd7..3156d271 100644
--- a/plugins/check_ide_smart.c
+++ b/plugins/check_ide_smart.c
@@ -181,11 +181,14 @@ main (int argc, char *argv[])
181 while (1) { 181 while (1) {
182 182
183 o = getopt_long (argc, argv, "+d:iq10nhV", longopts, &longindex); 183 o = getopt_long (argc, argv, "+d:iq10nhV", longopts, &longindex);
184
185 if (o == -1 || o == EOF)
186 break;
187 184
188 switch (o) { 185 switch (o) {
186 case -1:
187 /*
188 * bail out of the switch but not the loop, so
189 * that device can be extracted from argv.
190 */
191 break;
189 case 'd': 192 case 'd':
190 device = optarg; 193 device = optarg;
191 break; 194 break;
@@ -226,7 +229,7 @@ main (int argc, char *argv[])
226 fd = open (device, O_RDONLY); 229 fd = open (device, O_RDONLY);
227 230
228 if (fd < 0) { 231 if (fd < 0) {
229 printf (_("CRITICAL - Couldn't open device: %s\n"), strerror (errno)); 232 printf (_("CRITICAL - Couldn't open device %s: %s\n"), device, strerror (errno));
230 return 2; 233 return 2;
231 } 234 }
232 235
@@ -498,12 +501,13 @@ print_help (void)
498 printf ("(C) 1999 Ragnar Hojland Espinosa <ragnar@lightside.dhis.org>\n"); 501 printf ("(C) 1999 Ragnar Hojland Espinosa <ragnar@lightside.dhis.org>\n");
499 printf (COPYRIGHT, copyright, email); 502 printf (COPYRIGHT, copyright, email);
500 503
501 printf(_("This plugin checks this host's IDE hard drive through the (Linux specific) SMART command interface.\n\n")); 504 printf(_("This plugin checks a local hard drive with the (Linux specific) SMART interface [http://smartlinux.sourceforge.net/smart/index.php].\n\n"));
502 505
503 printf ("\ 506 printf ("\
504Usage: %s [DEVICE] [OPTION]\n\ 507Usage: %s [OPTION] [DEVICE]\n\
505 -d, --device=DEVICE\n\ 508 -d, --device=DEVICE\n\
506 Select device DEVICE\n\ 509 Select device DEVICE\n\
510 Note: if the device is selected with this option, _no_ other options are accepted\n\
507 -i, --immediate\n\ 511 -i, --immediate\n\
508 Perform immediately offline tests\n\ 512 Perform immediately offline tests\n\
509 -q, --quiet-check\n\ 513 -q, --quiet-check\n\