From 536d8e700267432dc7b3ab0504d80a9071972a22 Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Thu, 31 Oct 2024 03:48:28 +0100 Subject: check_ide_smart: clang-format diff --git a/plugins/check_ide_smart.c b/plugins/check_ide_smart.c index 3872e34..00d9eb3 100644 --- a/plugins/check_ide_smart.c +++ b/plugins/check_ide_smart.c @@ -1,112 +1,105 @@ /***************************************************************************** -* -* Monitoring check_ide_smart plugin -* ide-smart 1.3 - IDE S.M.A.R.T. checking tool -* -* License: GPL -* Copyright (C) 1998-1999 Ragnar Hojland Espinosa -* 1998 Gadi Oxman -* Copyright (c) 2000 Robert Dale -* Copyright (c) 2000-2007 Monitoring Plugins Development Team -* -* Description: -* -* This file contains the check_ide_smart plugin -* -* This plugin checks a local hard drive with the (Linux specific) SMART -* interface -* -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -* -*****************************************************************************/ + * + * Monitoring check_ide_smart plugin + * ide-smart 1.3 - IDE S.M.A.R.T. checking tool + * + * License: GPL + * Copyright (C) 1998-1999 Ragnar Hojland Espinosa + * 1998 Gadi Oxman + * Copyright (c) 2000 Robert Dale + * Copyright (c) 2000-2007 Monitoring Plugins Development Team + * + * Description: + * + * This file contains the check_ide_smart plugin + * + * This plugin checks a local hard drive with the (Linux specific) SMART + * interface + * + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * + *****************************************************************************/ const char *progname = "check_ide_smart"; const char *copyright = "1998-2007"; const char *email = "devel@monitoring-plugins.org"; - + #include "common.h" #include "utils.h" -void print_help (void); -void print_usage (void); +void print_help(void); +void print_usage(void); #include #include #include #ifdef __linux__ -#include -#include +# include +# include -#define OPEN_MODE O_RDONLY +# define OPEN_MODE O_RDONLY #endif /* __linux__ */ #ifdef __NetBSD__ -#include -#include -#include -#include /* for __u8 and friends */ -#include -#include -#include -#include - -#define SMART_ENABLE WDSM_ENABLE_OPS -#define SMART_DISABLE WDSM_DISABLE_OPS -#define SMART_IMMEDIATE_OFFLINE WDSM_EXEC_OFFL_IMM -#define SMART_AUTO_OFFLINE 0xdb /* undefined in NetBSD headers */ - -#define OPEN_MODE O_RDWR +# include +# include +# include +# include /* for __u8 and friends */ +# include +# include +# include +# include + +# define SMART_ENABLE WDSM_ENABLE_OPS +# define SMART_DISABLE WDSM_DISABLE_OPS +# define SMART_IMMEDIATE_OFFLINE WDSM_EXEC_OFFL_IMM +# define SMART_AUTO_OFFLINE 0xdb /* undefined in NetBSD headers */ + +# define OPEN_MODE O_RDWR #endif /* __NetBSD__ */ #include - -#define NR_ATTRIBUTES 30 - -#define PREFAILURE 2 -#define ADVISORY 1 + +#define NR_ATTRIBUTES 30 + +#define PREFAILURE 2 +#define ADVISORY 1 #define OPERATIONAL 0 -#define UNKNOWN -1 +#define UNKNOWN -1 -typedef struct threshold_s -{ +typedef struct threshold_s { __u8 id; __u8 threshold; __u8 reserved[10]; -} -__attribute__ ((packed)) threshold_t; +} __attribute__((packed)) threshold_t; -typedef struct thresholds_s -{ +typedef struct thresholds_s { __u16 revision; threshold_t thresholds[NR_ATTRIBUTES]; __u8 reserved[18]; __u8 vendor[131]; __u8 checksum; -} -__attribute__ ((packed)) thresholds_t; +} __attribute__((packed)) thresholds_t; -typedef struct value_s -{ +typedef struct value_s { __u8 id; __u16 status; __u8 value; __u8 vendor[8]; -} -__attribute__ ((packed)) value_t; +} __attribute__((packed)) value_t; -typedef struct values_s -{ +typedef struct values_s { __u16 revision; value_t values[NR_ATTRIBUTES]; __u8 offline_status; @@ -118,60 +111,43 @@ typedef struct values_s __u8 reserved[16]; __u8 vendor[125]; __u8 checksum; -} -__attribute__ ((packed)) values_t; +} __attribute__((packed)) values_t; -struct -{ +struct { __u8 value; char *text; } -offline_status_text[] = - { - {0x00, "NeverStarted"}, - {0x02, "Completed"}, - {0x04, "Suspended"}, - {0x05, "Aborted"}, - {0x06, "Failed"}, - {0, 0} - }; - -struct -{ +offline_status_text[] = {{0x00, "NeverStarted"}, {0x02, "Completed"}, {0x04, "Suspended"}, {0x05, "Aborted"}, {0x06, "Failed"}, {0, 0}}; + +struct { __u8 value; char *text; } -smart_command[] = - { - {SMART_ENABLE, "SMART_ENABLE"}, - {SMART_DISABLE, "SMART_DISABLE"}, - {SMART_IMMEDIATE_OFFLINE, "SMART_IMMEDIATE_OFFLINE"}, - {SMART_AUTO_OFFLINE, "SMART_AUTO_OFFLINE"} - }; - - -/* Index to smart_command table, keep in order */ -enum SmartCommand - { SMART_CMD_ENABLE, - SMART_CMD_DISABLE, - SMART_CMD_IMMEDIATE_OFFLINE, - SMART_CMD_AUTO_OFFLINE - }; - -char *get_offline_text (int); -int smart_read_values (int, values_t *); -int nagios (values_t *, thresholds_t *); -void print_value (value_t *, threshold_t *); -void print_values (values_t *, thresholds_t *); -int smart_cmd_simple (int, enum SmartCommand, __u8, bool); -int smart_read_thresholds (int, thresholds_t *); +smart_command[] = {{SMART_ENABLE, "SMART_ENABLE"}, + {SMART_DISABLE, "SMART_DISABLE"}, + {SMART_IMMEDIATE_OFFLINE, "SMART_IMMEDIATE_OFFLINE"}, + {SMART_AUTO_OFFLINE, "SMART_AUTO_OFFLINE"}}; + +/* Index to smart_command table, keep in order */ +enum SmartCommand { + SMART_CMD_ENABLE, + SMART_CMD_DISABLE, + SMART_CMD_IMMEDIATE_OFFLINE, + SMART_CMD_AUTO_OFFLINE +}; + +char *get_offline_text(int); +int smart_read_values(int, values_t *); +int nagios(values_t *, thresholds_t *); +void print_value(value_t *, threshold_t *); +void print_values(values_t *, thresholds_t *); +int smart_cmd_simple(int, enum SmartCommand, __u8, bool); +int smart_read_thresholds(int, thresholds_t *); bool verbose = false; -int -main (int argc, char *argv[]) -{ +int main(int argc, char *argv[]) { char *device = NULL; int o, longindex; int retval = 0; @@ -180,28 +156,26 @@ main (int argc, char *argv[]) values_t values; int fd; - static struct option longopts[] = { - {"device", required_argument, 0, 'd'}, - {"immediate", no_argument, 0, 'i'}, - {"quiet-check", no_argument, 0, 'q'}, - {"auto-on", no_argument, 0, '1'}, - {"auto-off", no_argument, 0, '0'}, - {"nagios", no_argument, 0, 'n'}, /* DEPRECATED, but we still accept it */ - {"help", no_argument, 0, 'h'}, - {"version", no_argument, 0, 'V'}, - {0, 0, 0, 0} - }; + static struct option longopts[] = {{"device", required_argument, 0, 'd'}, + {"immediate", no_argument, 0, 'i'}, + {"quiet-check", no_argument, 0, 'q'}, + {"auto-on", no_argument, 0, '1'}, + {"auto-off", no_argument, 0, '0'}, + {"nagios", no_argument, 0, 'n'}, /* DEPRECATED, but we still accept it */ + {"help", no_argument, 0, 'h'}, + {"version", no_argument, 0, 'V'}, + {0, 0, 0, 0}}; /* Parse extra opts if any */ - argv=np_extra_opts (&argc, argv, progname); + argv = np_extra_opts(&argc, argv, progname); - setlocale (LC_ALL, ""); - bindtextdomain (PACKAGE, LOCALEDIR); - textdomain (PACKAGE); + setlocale(LC_ALL, ""); + bindtextdomain(PACKAGE, LOCALEDIR); + textdomain(PACKAGE); while (true) { - - o = getopt_long (argc, argv, "+d:iq10nhVv", longopts, &longindex); + + o = getopt_long(argc, argv, "+d:iq10nhVv", longopts, &longindex); if (o == -1 || o == EOF || o == 1) break; @@ -211,30 +185,30 @@ main (int argc, char *argv[]) device = optarg; break; case 'q': - fprintf (stderr, "%s\n", _("DEPRECATION WARNING: the -q switch (quiet output) is no longer \"quiet\".")); - fprintf (stderr, "%s\n", _("Nagios-compatible output is now always returned.")); + fprintf(stderr, "%s\n", _("DEPRECATION WARNING: the -q switch (quiet output) is no longer \"quiet\".")); + fprintf(stderr, "%s\n", _("Nagios-compatible output is now always returned.")); break; case 'i': case '1': case '0': - printf ("%s\n", _("SMART commands are broken and have been disabled (See Notes in --help).")); + printf("%s\n", _("SMART commands are broken and have been disabled (See Notes in --help).")); return STATE_CRITICAL; break; case 'n': - fprintf (stderr, "%s\n", _("DEPRECATION WARNING: the -n switch (Nagios-compatible output) is now the")); - fprintf (stderr, "%s\n", _("default and will be removed from future releases.")); + fprintf(stderr, "%s\n", _("DEPRECATION WARNING: the -n switch (Nagios-compatible output) is now the")); + fprintf(stderr, "%s\n", _("default and will be removed from future releases.")); break; case 'v': /* verbose */ verbose = true; break; case 'h': - print_help (); + print_help(); return STATE_UNKNOWN; case 'V': - print_revision (progname, NP_VERSION); + print_revision(progname, NP_VERSION); return STATE_UNKNOWN; default: - usage5 (); + usage5(); } } @@ -243,36 +217,33 @@ main (int argc, char *argv[]) } if (!device) { - print_help (); + print_help(); return STATE_UNKNOWN; } - fd = open (device, OPEN_MODE); + fd = open(device, OPEN_MODE); if (fd < 0) { - printf (_("CRITICAL - Couldn't open device %s: %s\n"), device, strerror (errno)); + printf(_("CRITICAL - Couldn't open device %s: %s\n"), device, strerror(errno)); return STATE_CRITICAL; } - if (smart_cmd_simple (fd, SMART_CMD_ENABLE, 0, false)) { - printf (_("CRITICAL - SMART_CMD_ENABLE\n")); + if (smart_cmd_simple(fd, SMART_CMD_ENABLE, 0, false)) { + printf(_("CRITICAL - SMART_CMD_ENABLE\n")); return STATE_CRITICAL; } - smart_read_values (fd, &values); - smart_read_thresholds (fd, &thresholds); - retval = nagios (&values, &thresholds); - if (verbose) print_values (&values, &thresholds); + smart_read_values(fd, &values); + smart_read_thresholds(fd, &thresholds); + retval = nagios(&values, &thresholds); + if (verbose) + print_values(&values, &thresholds); - close (fd); + close(fd); return retval; } - - -char * -get_offline_text (int status) -{ +char *get_offline_text(int status) { int i; for (i = 0; offline_status_text[i].text; i++) { if (offline_status_text[i].value == status) { @@ -282,11 +253,7 @@ get_offline_text (int status) return "UNKNOWN"; } - - -int -smart_read_values (int fd, values_t * values) -{ +int smart_read_values(int fd, values_t *values) { #ifdef __linux__ int e; __u8 args[4 + 512]; @@ -294,12 +261,12 @@ smart_read_values (int fd, values_t * values) args[1] = 0; args[2] = SMART_READ_VALUES; args[3] = 1; - if (ioctl (fd, HDIO_DRIVE_CMD, &args)) { + if (ioctl(fd, HDIO_DRIVE_CMD, &args)) { e = errno; - printf (_("CRITICAL - SMART_READ_VALUES: %s\n"), strerror (errno)); + printf(_("CRITICAL - SMART_READ_VALUES: %s\n"), strerror(errno)); return e; } - memcpy (values, args + 4, 512); + memcpy(values, args + 4, 512); #endif /* __linux__ */ #ifdef __NetBSD__ struct atareq req; @@ -323,7 +290,7 @@ smart_read_values (int fd, values_t * values) if (errno != 0) { int e = errno; - printf (_("CRITICAL - SMART_READ_VALUES: %s\n"), strerror (errno)); + printf(_("CRITICAL - SMART_READ_VALUES: %s\n"), strerror(errno)); return e; } @@ -332,13 +299,9 @@ smart_read_values (int fd, values_t * values) return 0; } - - -int -nagios (values_t * p, thresholds_t * t) -{ - value_t * value = p->values; - threshold_t * threshold = t->thresholds; +int nagios(values_t *p, thresholds_t *t) { + value_t *value = p->values; + threshold_t *threshold = t->thresholds; int status = OPERATIONAL; int prefailure = 0; int advisory = 0; @@ -353,13 +316,11 @@ nagios (values_t * p, thresholds_t * t) if (value->status & 1) { status = PREFAILURE; ++prefailure; - } - else { + } else { status = ADVISORY; ++advisory; } - } - else { + } else { ++passed; } ++total; @@ -369,81 +330,49 @@ nagios (values_t * p, thresholds_t * t) } switch (status) { case PREFAILURE: - printf (_("CRITICAL - %d Harddrive PreFailure%cDetected! %d/%d tests failed.\n"), - prefailure, - prefailure > 1 ? 's' : ' ', - failed, - total); - status=STATE_CRITICAL; + printf(_("CRITICAL - %d Harddrive PreFailure%cDetected! %d/%d tests failed.\n"), prefailure, prefailure > 1 ? 's' : ' ', failed, + total); + status = STATE_CRITICAL; break; case ADVISORY: - printf (_("WARNING - %d Harddrive Advisor%s Detected. %d/%d tests failed.\n"), - advisory, - advisory > 1 ? "ies" : "y", - failed, - total); - status=STATE_WARNING; + printf(_("WARNING - %d Harddrive Advisor%s Detected. %d/%d tests failed.\n"), advisory, advisory > 1 ? "ies" : "y", failed, total); + status = STATE_WARNING; break; case OPERATIONAL: - printf (_("OK - Operational (%d/%d tests passed)\n"), passed, total); - status=STATE_OK; + printf(_("OK - Operational (%d/%d tests passed)\n"), passed, total); + status = STATE_OK; break; default: - printf (_("ERROR - Status '%d' unknown. %d/%d tests passed\n"), status, - passed, total); + printf(_("ERROR - Status '%d' unknown. %d/%d tests passed\n"), status, passed, total); status = STATE_UNKNOWN; break; } return status; } - - -void -print_value (value_t * p, threshold_t * t) -{ - printf ("Id=%3d, Status=%2d {%s , %s}, Value=%3d, Threshold=%3d, %s\n", - p->id, p->status, p->status & 1 ? "PreFailure" : "Advisory ", - p->status & 2 ? "OnLine " : "OffLine", p->value, t->threshold, - p->value >= t->threshold ? "Passed" : "Failed"); +void print_value(value_t *p, threshold_t *t) { + printf("Id=%3d, Status=%2d {%s , %s}, Value=%3d, Threshold=%3d, %s\n", p->id, p->status, p->status & 1 ? "PreFailure" : "Advisory ", + p->status & 2 ? "OnLine " : "OffLine", p->value, t->threshold, p->value >= t->threshold ? "Passed" : "Failed"); } - - -void -print_values (values_t * p, thresholds_t * t) -{ - value_t * value = p->values; - threshold_t * threshold = t->thresholds; +void print_values(values_t *p, thresholds_t *t) { + value_t *value = p->values; + threshold_t *threshold = t->thresholds; int i; for (i = 0; i < NR_ATTRIBUTES; i++) { if (value->id && threshold->id && value->id == threshold->id) { - print_value (value++, threshold++); + print_value(value++, threshold++); } } - printf - (_("OffLineStatus=%d {%s}, AutoOffLine=%s, OffLineTimeout=%d minutes\n"), - p->offline_status, - get_offline_text (p->offline_status & 0x7f), - (p->offline_status & 0x80 ? "Yes" : "No"), - p->offline_timeout / 60); - printf - (_("OffLineCapability=%d {%s %s %s}\n"), - p->offline_capability, - p->offline_capability & 1 ? "Immediate" : "", - p->offline_capability & 2 ? "Auto" : "", - p->offline_capability & 4 ? "AbortOnCmd" : "SuspendOnCmd"); - printf - (_("SmartRevision=%d, CheckSum=%d, SmartCapability=%d {%s %s}\n"), - p->revision, - p->checksum, - p->smart_capability, - p->smart_capability & 1 ? "SaveOnStandBy" : "", - p->smart_capability & 2 ? "AutoSave" : ""); + printf(_("OffLineStatus=%d {%s}, AutoOffLine=%s, OffLineTimeout=%d minutes\n"), p->offline_status, + get_offline_text(p->offline_status & 0x7f), (p->offline_status & 0x80 ? "Yes" : "No"), p->offline_timeout / 60); + printf(_("OffLineCapability=%d {%s %s %s}\n"), p->offline_capability, p->offline_capability & 1 ? "Immediate" : "", + p->offline_capability & 2 ? "Auto" : "", p->offline_capability & 4 ? "AbortOnCmd" : "SuspendOnCmd"); + printf(_("SmartRevision=%d, CheckSum=%d, SmartCapability=%d {%s %s}\n"), p->revision, p->checksum, p->smart_capability, + p->smart_capability & 1 ? "SaveOnStandBy" : "", p->smart_capability & 2 ? "AutoSave" : ""); } - -int smart_cmd_simple (int fd, enum SmartCommand command, __u8 val0, bool show_error) { +int smart_cmd_simple(int fd, enum SmartCommand command, __u8 val0, bool show_error) { int e = STATE_UNKNOWN; #ifdef __linux__ __u8 args[4]; @@ -451,14 +380,14 @@ int smart_cmd_simple (int fd, enum SmartCommand command, __u8 val0, bool show_er args[1] = val0; args[2] = smart_command[command].value; args[3] = 0; - if (ioctl (fd, HDIO_DRIVE_CMD, &args)) { + if (ioctl(fd, HDIO_DRIVE_CMD, &args)) { e = STATE_CRITICAL; if (show_error) - printf (_("CRITICAL - %s: %s\n"), smart_command[command].text, strerror (errno)); + printf(_("CRITICAL - %s: %s\n"), smart_command[command].text, strerror(errno)); } else { e = STATE_OK; if (show_error) - printf (_("OK - Command sent (%s)\n"), smart_command[command].text); + printf(_("OK - Command sent (%s)\n"), smart_command[command].text); } #endif /* __linux__ */ @@ -483,35 +412,31 @@ int smart_cmd_simple (int fd, enum SmartCommand command, __u8 val0, bool show_er if (errno != 0) { e = STATE_CRITICAL; if (show_error) - printf (_("CRITICAL - %s: %s\n"), smart_command[command].text, strerror (errno)); + printf(_("CRITICAL - %s: %s\n"), smart_command[command].text, strerror(errno)); } else { e = STATE_OK; if (show_error) - printf (_("OK - Command sent (%s)\n"), smart_command[command].text); + printf(_("OK - Command sent (%s)\n"), smart_command[command].text); } #endif /* __NetBSD__ */ return e; } - - -int -smart_read_thresholds (int fd, thresholds_t * thresholds) -{ +int smart_read_thresholds(int fd, thresholds_t *thresholds) { #ifdef __linux__ int e; __u8 args[4 + 512]; args[0] = WIN_SMART; - args[1] = 0; - args[2] = SMART_READ_THRESHOLDS; - args[3] = 1; - if (ioctl (fd, HDIO_DRIVE_CMD, &args)) { + args[1] = 0; + args[2] = SMART_READ_THRESHOLDS; + args[3] = 1; + if (ioctl(fd, HDIO_DRIVE_CMD, &args)) { e = errno; - printf (_("CRITICAL - SMART_READ_THRESHOLDS: %s\n"), strerror (errno)); + printf(_("CRITICAL - SMART_READ_THRESHOLDS: %s\n"), strerror(errno)); return e; } - memcpy (thresholds, args + 4, 512); + memcpy(thresholds, args + 4, 512); #endif /* __linux__ */ #ifdef __NetBSD__ struct atareq req; @@ -535,7 +460,7 @@ smart_read_thresholds (int fd, thresholds_t * thresholds) if (errno != 0) { int e = errno; - printf (_("CRITICAL - SMART_READ_THRESHOLDS: %s\n"), strerror (errno)); + printf(_("CRITICAL - SMART_READ_THRESHOLDS: %s\n"), strerror(errno)); return e; } @@ -544,45 +469,43 @@ smart_read_thresholds (int fd, thresholds_t * thresholds) return 0; } +void print_help(void) { + print_revision(progname, NP_VERSION); -void -print_help (void) -{ - print_revision (progname, NP_VERSION); + printf("(C) 1999 Ragnar Hojland Espinosa \n"); + printf("Plugin implementation - 1999 Robert Dale \n"); + printf(COPYRIGHT, copyright, email); - printf ("(C) 1999 Ragnar Hojland Espinosa \n"); - printf ("Plugin implementation - 1999 Robert Dale \n"); - printf (COPYRIGHT, copyright, email); + printf(_("This plugin checks a local hard drive with the (Linux specific) SMART interface " + "[http://smartlinux.sourceforge.net/smart/index.php].")); - printf (_("This plugin checks a local hard drive with the (Linux specific) SMART interface [http://smartlinux.sourceforge.net/smart/index.php].")); + printf("\n\n"); - printf ("\n\n"); + print_usage(); - print_usage (); + printf(UT_HELP_VRSN); + printf(UT_EXTRA_OPTS); - printf (UT_HELP_VRSN); - printf (UT_EXTRA_OPTS); + printf(" %s\n", "-d, --device=DEVICE"); + printf(" %s\n", _("Select device DEVICE")); + printf(" %s\n", _("Note: if the device is specified without this option, any further option will")); + printf(" %s\n", _("be ignored.")); - printf (" %s\n", "-d, --device=DEVICE"); - printf (" %s\n", _("Select device DEVICE")); - printf (" %s\n", _("Note: if the device is specified without this option, any further option will")); - printf (" %s\n", _("be ignored.")); + printf(UT_VERBOSE); - printf (UT_VERBOSE); + printf("\n"); + printf("%s\n", _("Notes:")); + printf(" %s\n", _("The SMART command modes (-i/--immediate, -0/--auto-off and -1/--auto-on) were")); + printf(" %s\n", _("broken in an underhand manner and have been disabled. You can use smartctl")); + printf(" %s\n", _("instead:")); + printf(" %s\n", _("-0/--auto-off: use \"smartctl --offlineauto=off\"")); + printf(" %s\n", _("-1/--auto-on: use \"smartctl --offlineauto=on\"")); + printf(" %s\n", _("-i/--immediate: use \"smartctl --test=offline\"")); - printf ("\n"); - printf ("%s\n", _("Notes:")); - printf (" %s\n", _("The SMART command modes (-i/--immediate, -0/--auto-off and -1/--auto-on) were")); - printf (" %s\n", _("broken in an underhand manner and have been disabled. You can use smartctl")); - printf (" %s\n", _("instead:")); - printf (" %s\n", _("-0/--auto-off: use \"smartctl --offlineauto=off\"")); - printf (" %s\n", _("-1/--auto-on: use \"smartctl --offlineauto=on\"")); - printf (" %s\n", _("-i/--immediate: use \"smartctl --test=offline\"")); - - printf (UT_SUPPORT); + printf(UT_SUPPORT); } - /* todo : add to the long nanual as example +/* todo : add to the long nanual as example * * Run with: check_ide-smart --nagios [-d] * Where DRIVE is an IDE drive, ie. /dev/hda, /dev/hdb, /dev/hdc @@ -593,10 +516,7 @@ print_help (void) * - Returns -1 not too often */ - -void -print_usage (void) -{ - printf ("%s\n", _("Usage:")); - printf ("%s [-d ] [-v]", progname); +void print_usage(void) { + printf("%s\n", _("Usage:")); + printf("%s [-d ] [-v]", progname); } -- cgit v0.10-9-g596f