Page MenuHomePhabricator

get-raid-status-perccli should allow for commands to return non-zero exit code
Closed, DeclinedPublic

Description

In presence of errors, perccli64 returns non-zero status and makes the script fail:

$ sudo /usr/local/lib/nagios/plugins/get-raid-status-perccli
perccli64 command failed Command '['/usr/bin/perccli64', '/call/vall show all J']' returned non-zero exit status 45.

In this case for example:

$ sudo /usr/bin/perccli64 /call/vall show all J
{
"Controllers":[
{
	"Command Status" : {
		"CLI Version" : "007.1910.0000.0000 Oct 08, 2021",
		"Operating system" : "Linux 5.10.0-18-amd64",
		"Controller" : 0,
		"Status" : "Failure",
		"Description" : "None",
		"Detailed Status" : [
			{
				"VD" : 239,
				"Status" : "Failed",
				"ErrCd" : 45,
				"ErrMsg" : "device busy or unexpected error occurred"
			}
		]
	},
	"Response Data" : {
		"/c0/v239" : [
			{
				"DG/VD" : "0/239",
				"TYPE" : "RAID10",
				"State" : "Dgrd",
				"Access" : "RW",
				"Consist" : "Yes",
				"Cache" : "RWBD",
				"Cac" : "-",
				"sCC" : "OFF",
				"Size" : "8.729 TB",
				"Name" : ""
			}
		]
	}
}
]
}

and the exit code is 45.

Also, the icinga alert seems to be cut on the first pipe symbol '|'. Eg: "Dell PowerEdge RAID Controller": "communication 0 OK"

Related Objects

Event Timeline

Volans triaged this task as Medium priority.
Restricted Application added a subscriber: • Aklapper. · View Herald Transcript

FYI, For the rebuilt after a disk change, the utility is working:

sudo /usr/local/lib/nagios/plugins/get-raid-status-perccli
communication 0 OK | controller: 1 Needs Attention | physical_disk: 1 Rbld | virtual_disk: 1 Dgrd | bbu: 0 OK | enclosure: 0 OK

But icinga is giving out missleading text:

CRIT: "communication 0 OK"

It should probably return a warning or a critical informing a rebuild is in process / virtual disk is still degraded.

This last part is not super important, but completing the bug report (my guess this is an icinga special formatting).

SLyngshede-WMF lowered the priority of this task from Medium to Low.

Script no longer exists.