@@ -0,0 +1,62 @@
+--- plugins/check_ide_smart.c.orig 2013-11-24 11:30:58.436360581 +0100
++++ plugins/check_ide_smart.c 2013-11-24 12:33:59.765054497 +0100
+@@ -180,6 +180,7 @@
+ int command = -1;
+ int o, longindex;
+ int retval = 0;
++ int smartenable = 1;
+
+ thresholds_t thresholds;
+ values_t values;
+@@ -192,6 +193,7 @@
+ {"auto-on", no_argument, 0, '1'},
+ {"auto-off", no_argument, 0, '0'},
+ {"nagios", no_argument, 0, 'n'},
++ {"disable_smartenable", no_argument, 0, 'N'},
+ {"help", no_argument, 0, 'h'},
+ {"version", no_argument, 0, 'V'},
+ {0, 0, 0, 0}
+@@ -206,7 +208,7 @@
+
+ while (1) {
+
+- o = getopt_long (argc, argv, "+d:iq10nhV", longopts, &longindex);
++ o = getopt_long (argc, argv, "+d:iq10nNhV", longopts, &longindex);
+
+ if (o == -1 || o == EOF || o == 1)
+ break;
+@@ -230,6 +232,9 @@
+ case 'n':
+ command = 4;
+ break;
++ case 'N':
++ smartenable = 0;
++ break;
+ case 'h':
+ print_help ();
+ return STATE_OK;
+@@ -256,10 +261,11 @@
+ printf (_("CRITICAL - Couldn't open device %s: %s\n"), device, strerror (errno));
+ return STATE_CRITICAL;
+ }
+-
+- if (smart_cmd_simple (fd, SMART_CMD_ENABLE, 0, TRUE)) {
+- printf (_("CRITICAL - SMART_CMD_ENABLE\n"));
+- return STATE_CRITICAL;
++ if ( smartenable == 1 ) {
++ if (smart_cmd_simple (fd, SMART_CMD_ENABLE, 0, TRUE)) {
++ printf (_("CRITICAL - SMART_CMD_ENABLE\n"));
++ return STATE_CRITICAL;
++ }
+ }
+
+ switch (command) {
+@@ -618,6 +624,8 @@
+ printf (" %s\n", _("Turn off automatic offline tests"));
+ printf (" %s\n", "-n, --nagios");
+ printf (" %s\n", _("Output suitable for Nagios"));
++ printf (" %s\n", "-N, --disable_smartenable");
++ printf (" %s\n", _("Disable SMART_ENABLE command on startup"));
+
+ printf (UT_SUPPORT);
+ }
|