nagios-plugin-check_raid icon indicating copy to clipboard operation
nagios-plugin-check_raid copied to clipboard

msa1500 serial line check errors

Open mesb1 opened this issue 9 years ago • 8 comments

Hi.

Have msa1500. Serial line nagios machine connected to it. There is only one controller in this setup.

I get new version via:

wget https://raw.github.com/glensc/nagios-plugin-check_raid/master/check_raid.pl -O check_raid.pl

Then:

./check_raid.pl -d -p hp_msa --plugin-option=hp_msa-serial=/dev/ttyS0 --plugin-option=hp_msa-enabled
check_raid Version 3.2.3
See CONTRIBUTING.md how to report bugs with debug data:
https://github.com/glensc/nagios-plugin-check_raid/blob/master/CONTRIBUTING.md

UNKNOWN: hp_msa:[Plugin error]

I look inside and looks like it gave controller few commands:

CLI-1>show globals

Global Parameters:
System Name:

Rebuild Priority: medium
Expand Priority: medium
Surface Delay: 3.0 seconds

Total Cache: 256MB
60% Read Cache: 154MB
40% Write Cache: 102MB

Temperature:
EMU: 23 Celsius, 73 Fahrenheit
PS1: 24 Celsius, 75 Fahrenheit
PS2: 24 Celsius, 75 Fahrenheit

CLI-1> show this_controller 
Controller 1 (right controller):
MSA1500(c) Hewlett-Packard PB9840KX3T40BP Version 5.20 Build 1500 Hardware A
Build Time: 2007-01-24 16:03:28
Component Enclosure.
Controller Identifier: 
NODE_ID = 500508B3-009293D0
SCSI_VERSION = SCSI-3
Supported Redundancy Mode: Active/Standby Asym-Active/Active 
Current Redundancy Mode: Not Redundant (No Failure)
Device Port SCSI address 6
Terminal speed for the CLI is set to 19200.
Host Port_1:
REPORTED PORT_ID 500508B3-009293D1
PORT_1_TOPOLOGY = F_Port
Cache:
154 megabyte read cache 102 megabyte write cache Version 2
Cache is GOOD, and Cache is enabled.
No unflushed data in cache
Batteries are disabled
Module #1 is fully charged and turned off.
Controller Up Time:
122 Days 13 Hours 57 Minutes 37 Seconds
Health:
Surface Scan: Complete.
Rebuild Status: Complete.
Expansion: Complete.

CLI-1>

CLI-1> show other_controller
Other controller is not present or fully started.

CLI-1> exit

Invalid CLI command.

CLI-1>

If you need more checking this part of script i can try find couple free hdd for making test unit like raid1+hot spare.

mesb1 avatar Apr 18 '15 22:04 mesb1

Checking latest:

./check_raid.pl -d -p hp_msa --plugin-option=hp_msa-serial=/dev/ttyS0 --plugin-option=hp_msa-enabled
check_raid Version 3.2.4
See CONTRIBUTING.md how to report bugs with debug data:
https://github.com/glensc/nagios-plugin-check_raid/blob/master/CONTRIBUTING.md

And no any output. But when i break script and connect via minicom and try put enter, msa say too long command. Looks like there was send something, but maybe wrong way?

I can't see any settings of com port inside script like: 19200 8N1 no hardware flow control no software flow control.

How it can use comport if no any settings for it?

mesb1 avatar Aug 21 '15 07:08 mesb1

Did some research: There must be atleast:

my $port = new Device::SerialPort("/dev/ttyS0"); 
$port->user_msg(ON); 
$port->baudrate(19200); 
$port->parity("none"); 
$port->databits(8); 
$port->stopbits(1); 
$port->handshake("xoff"); 
$port->write_settings;
$port->lookclear; 
$port->write("some command to com-port");

my $answer = $port->lookfor;

mesb1 avatar Aug 21 '15 07:08 mesb1

i'm not sure, but afaik the port settings are "default" if the script does not change them, and "defaults" are set with setserial from rc.serial, or whatever is default by kernel (dmesg |grep ttyS).

so in my script just open /dev/ttyS0 like bidirectional file

glensc avatar Aug 21 '15 07:08 glensc

so, give Device::SerialPort a try, change in package hp_msa:

my $modem = SerialLine->new($ctldevice, %opts);

with Device::SerialPort use

(I don't have this hardware anymore, nor any hardware to connect with serial port to test this myself)

glensc avatar Aug 21 '15 07:08 glensc

Ok, i will try. For now is playing with setserial /dev/ttyS0 baud_base 19200 but not very lucky.

mesb1 avatar Aug 21 '15 08:08 mesb1

Well, looks like it's not quite normal doing it via setserial. As example there is parameters for msa like 19200 8N1, we can't set any of them exept base_baud 19200.

For now try some script that is working: use Device::SerialPort; my $port = Device::SerialPort->new("/dev/ttyS0");

$port->baudrate(19200); $port->databits(8); $port->parity("none"); $port->stopbits(1); $port->write("show globals\rshow this_controller\rshow other_controller\rexit\r");

while(1) { my $byte=$port->read(1); print "$byte"; }

But have problems for now with inserting this inside of hp_msa plugin.

P.S. Wasn't trying to look into 4.x.x for now. I'am on 3.2.x version.

mesb1 avatar Jan 14 '16 13:01 mesb1

so rebase your work on 4.x branch

glensc avatar Jan 14 '16 14:01 glensc

there was bug parsing commandline options, this has been fixed now:

  • fix plugin commandline options support, a2c5b8a

glensc avatar Nov 19 '16 21:11 glensc