Zabbix-userparameter – checking the multipathing

Here are some “quick & dirty” working userparameter for Zabbix :), they check:

  • how many paths per device are available,
  • if some of that paths are in a faulty state

Number of paths

UserParameter=Count.Multipath.Devices, echo $(( $(echo 'show paths' | sudo /sbin/multipathd -k | grep ready | wc -l) / $(echo 'show maps' | sudo /sbin/multipathd -k | grep dm | wc -l) ))

this mix of commands uses the multipathd -k and gets the paths and maps. Is the amount of paths / maps = 4 we assume that all 4 paths for each device is ok.

Checking if some is faulty

UserParameter=Check.Failed.Path, echo 'show paths' | sudo /sbin/multipathd -k | awk '/failed/||/faulty/||/shaky/||/offline/ {print $2,$5,$6,$7}'|wc -l

We pipe the output of echo 'show path' | multipathd -k in an awk and check if the following failure is in the returnvalue
shaky / faulty If a path connected and ready for I/O is the status “online”, otherwise the status is faulty or shaky.
failed is a DM down, its marked as “failed”. It means the same like “faulty”.
offline Is a SCSI Device deactivated, the Online_Status changed to offline.

The returnvalue of this script is 0, when everything is ok. Is the returnwert something else, you have to check the multipathing.

Trigger

The trigger in zabbix react to the specific values and because of that, the escalation starts.

Berechtigungen

To use multipathd in this way, you have to configure some permissions in sudo to get the job done. Take a look to this article SUDO Settings for Zabbix.

Leave a Reply

Your email address will not be published. Required fields are marked *

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax