aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/nagios-check_smartmon/files/patch-check_smartmon
blob: a938ccd345f2ab29e3bdfd825cf7a244983af877 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
--- check_smartmon.orig	2019-02-01 04:28:13.000000000 +0000
+++ check_smartmon	2019-02-04 22:27:35.297345000 +0000
@@ -161,9 +161,12 @@ 
                 lines = healthMessage.split("\n")
                 getNext = 0
                 for line in lines:
+                        vprint(3, "parseOutput: line is: '%s'" % line)
                         if getNext:
-                                statusLine = line
-                                break
+                                if line <> "SMART STATUS RETURN: incomplete response, ATA output registers missing" and \
+                                   line <> "SMART Status not supported: Incomplete response, ATA output registers missing" :
+                                        statusLine = line
+                                        break
                         elif line == "=== START OF READ SMART DATA SECTION ===":
                                 getNext = 1
                         # fi
@@ -181,7 +184,7 @@ 
                         parts = line.split()
                         if len(parts):
                                 # 194 is the temperature value id
-                                if parts[0] == "194":
+                                if parts[0] == "194" or parts[0] == "190":
                                         temperature = int(parts[9])
                                         break
                                 # fi
@@ -225,6 +228,7 @@ 
 
         # this is absolutely critical!
         if healthStatus not in [ "PASSED", "OK" ]:
+                vprint(2, "Health status: %s" % healthStatus)
                 return (2, "CRITICAL: device does not pass health status")
         # fi
 
@@ -287,6 +291,7 @@ 
         # check device type, ATA is default
         vprint(2, "Get device type")
         devtype = options.devtype
+        vprint(2, "command line supplied device type is: %s" % devtype)
         if not devtype:
                 if device_re.search( device ):
                         devtype = "scsi"