Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cciss_vol_status exclude /dev/sg2 #149

Closed
PitoneMaledetto opened this issue Sep 15, 2016 · 23 comments
Closed

cciss_vol_status exclude /dev/sg2 #149

PitoneMaledetto opened this issue Sep 15, 2016 · 23 comments

Comments

@PitoneMaledetto
Copy link

Hi there I am running the plugin with -p cciss
I get this:
Remote command execution failed: cciss_vol_status: open /dev/sg2: No such file or directory

How can I exclude the missing directory, is there a switch to do so?

If I manually run on the server:
sudo /usr/bin/cciss_vol_status -V /dev/sg0 /dev/sg1

I get everything I need.
Thanks

@glensc
Copy link
Owner

glensc commented Sep 15, 2016

read CONTRIBUTING.md how to report bugs!

@PitoneMaledetto
Copy link
Author

---plugin version check_raid 4.0.2---

check_raid -d -p cciss
DEBUG EXEC: /sys/module/hpsa/refcnt at ./check_raid line 474.
DEBUG EXEC: /proc/driver/cciss at ./check_raid line 474.
DEBUG EXEC: >&2 /usr/bin/cciss_vol_status -v at ./check_raid line 470.
DEBUG EXEC: /usr/bin/cciss_vol_status -V /dev/sg0 /dev/sg1 /dev/sg2 at ./check_raid line 474.

cat /sys/module/hpsa/refcnt

3

cat /proc/driver/cciss

cat: /proc/driver/cciss: No such file or directory

/usr/bin/cciss_vol_status -v

cciss_vol_status version 1.11

/usr/bin/cciss_vol_status -V /dev/sg0 /dev/sg1 /dev/sg2

Controller: Smart Array
  Board ID: 0x21c0103c
  Logical drives: 1
  Running firmware: 3.56
  ROM firmware: 3.56
/dev/sda: (Smart Array) RAID 5 Volume 0 status: OK.   At least one spare drive designated.  At least one spare drive remains available.
  Physical drives: 4
         connector 1I box 1 bay 1                 HP      EH0600JEDHE                          S7M179FC0000K645BD9F     HPD4 OK
         connector 1I box 1 bay 2                 HP      EH0600JEDHE                          S7M15RXP0000M6470KYB     HPD4 OK
         connector 1I box 1 bay 3                 HP      EH0600JEDHE                          S7M16DNY0000M64722F9     HPD4 OK
         connector 1I box 1 bay 4                 HP      EH0600JEDHE                          S7M179320000K647JJ84     HPD4 OK
/dev/sg0(Smart Array:0): Non-Volatile Cache status:
                   Cache configured: Yes
                  Read cache memory: 182 MiB
                 Write cache memory: 1634 MiB
                Write cache enabled: Yes
   Flash backed cache present
Controller: Smart Array
  Board ID: 0x21c0103c
  Logical drives: 1
  Running firmware: 3.56
  ROM firmware: 3.56
/dev/sda: (Smart Array) RAID 5 Volume 0 status: OK.   At least one spare drive designated.  At least one spare drive remains available.
  Physical drives: 4
         connector 1I box 1 bay 1                 HP      EH0600JEDHE                          S7M179FC0000K645BD9F     HPD4 OK
         connector 1I box 1 bay 2                 HP      EH0600JEDHE                          S7M15RXP0000M6470KYB     HPD4 OK
         connector 1I box 1 bay 3                 HP      EH0600JEDHE                          S7M16DNY0000M64722F9     HPD4 OK
         connector 1I box 1 bay 4                 HP      EH0600JEDHE                          S7M179320000K647JJ84     HPD4 OK
/dev/sg1(Smart Array:0): Non-Volatile Cache status:
                   Cache configured: Yes
                  Read cache memory: 182 MiB
                 Write cache memory: 1634 MiB
                Write cache enabled: Yes
   Flash backed cache present
cciss_vol_status: open /dev/sg2: No such file or directory

@PitoneMaledetto
Copy link
Author

PitoneMaledetto commented Sep 16, 2016

Proposed solution:
A switch for the use of the cciss plugin in order to specify the number of sg# directories to check or to avoid non existent ones.

@glensc
Copy link
Owner

glensc commented Sep 16, 2016

i was rather thinking iterate over /dev/sgX nodes and skip ones that doesn't exist.

@glensc
Copy link
Owner

glensc commented Sep 16, 2016

i suppose you don't have lsscsi program installed? and if you do, show lsscsi -g and it's version lsscsi --version

@PitoneMaledetto
Copy link
Author

PitoneMaledetto commented Sep 20, 2016

CASE2

---plugin version check_raid 4.0.2---

check_raid -d -p cciss

DEBUG EXEC: /sys/module/hpsa/refcnt at ./check_raid line 474.
DEBUG EXEC: /proc/driver/cciss at ./check_raid line 474.
DEBUG EXEC: >&2 /usr/bin/cciss_vol_status -v at ./check_raid line 470.
DEBUG EXEC: /usr/bin/sudo -A /usr/bin/cciss_vol_status /dev/sg0 /dev/sg1 /dev/sg2 at ./check_raid line 474.
cciss_vol_status: /dev/sg1: Unknown SCSI device.
cciss_vol_status: /dev/sg2: Unknown SCSI device.
Can't locate object method "new" via package "App::Monitoring::Plugin::CheckRaid::Plugins::smartctl" (perhaps you forgot to load "App::Monitoring::Plugin::CheckRaid::Plugins::smartctl"?) at ./check_raid line 1879.

cat /sys/module/hpsa/refcnt

3

cat /proc/driver/cciss

cat: /proc/driver/cciss: No such file or directory

/usr/bin/cciss_vol_status -v

cciss_vol_status version 1.09

/usr/bin/sudo -A /usr/bin/cciss_vol_status /dev/sg0 /dev/sg1 /dev/sg2

/dev/sda: (Smart Array P420i) RAID 1 Volume 0 status: OK.   At least one spare drive designated.  At least one spare drive remains available.
/dev/sdb: (Smart Array P420i) RAID 5 Volume 1 status: OK.   At least one spare drive designated.  At least one spare drive remains available.
cciss_vol_status: /dev/sg1: Unknown SCSI device.
cciss_vol_status: /dev/sg2: Unknown SCSI device.

@PitoneMaledetto
Copy link
Author

CASE3

---plugin version check_raid 4.0.2---

check_raid -d -p cciss
Unknown option: p

cciss_vol_status: /dev/sg1: Unknown SCSI device.
cciss_vol_status: /dev/sg10: Unknown SCSI device.
cciss_vol_status: /dev/sg11: Unknown SCSI device.
cciss_vol_status: /dev/sg2: Unknown SCSI device.
cciss_vol_status: /dev/sg3: Unknown SCSI device.
cciss_vol_status: /dev/sg4: Unknown SCSI device.
cciss_vol_status: /dev/sg5: Unknown SCSI device.
cciss_vol_status: /dev/sg6: Unknown SCSI device.
cciss_vol_status: /dev/sg7: Unknown SCSI device.
cciss_vol_status: /dev/sg8: Unknown SCSI device.
cciss_vol_status: /dev/sg9: Unknown SCSI device.
OK: cciss:[/dev/sda: (Smart Array P410i) RAID 1 Volume 0 status: OK, /dev/sdb: (Smart Array P410i) RAID 1 Volume 1 status: OK.   At least one spare drive designated.  At least one spare drive remains available]```

N.B. to notice the error output: Unknown option: p

@PitoneMaledetto
Copy link
Author

PitoneMaledetto commented Sep 20, 2016

I don't have lsscsi installed. What information are you after?

in regard of CASE3 for example

# ls -rtl /dev/disk/by-id/
lrwxrwxrwx 1 root root  9 Mar 29 09:24 wwn-0x600c0ff0001330db41a6525501000000 -> ../../sdi
lrwxrwxrwx 1 root root  9 Mar 29 09:24 scsi-3600c0ff0001330db41a6525501000000 -> ../../sdi
lrwxrwxrwx 1 root root  9 Mar 29 09:24 wwn-0x600c0ff0001330db5ba2525501000000 -> ../../sdg
lrwxrwxrwx 1 root root  9 Mar 29 09:24 scsi-3600c0ff0001330db5ba2525501000000 -> ../../sdg
lrwxrwxrwx 1 root root  9 Mar 29 09:24 wwn-0x600c0ff00013309dc4a4525501000000 -> ../../sdh
lrwxrwxrwx 1 root root  9 Mar 29 09:24 scsi-3600c0ff00013309dc4a4525501000000 -> ../../sdh
lrwxrwxrwx 1 root root  9 Mar 29 09:24 scsi-3600c0ff00013309d4da6525501000000 -> ../../sdj
lrwxrwxrwx 1 root root  9 Mar 29 09:24 wwn-0x600c0ff00013309d4da6525501000000 -> ../../sdj
lrwxrwxrwx 1 root root 10 Mar 29 09:24 wwn-0x600c0ff0001330db5ba2525501000000-part1 ->../../sdg1
lrwxrwxrwx 1 root root 10 Mar 29 09:24 scsi-3600c0ff0001330db5ba2525501000000-part1 -> ../../sdg1
lrwxrwxrwx 1 root root 10 Mar 29 09:24 scsi-3600c0ff0001330db41a6525501000000-part1 -> ../../sdi1
lrwxrwxrwx 1 root root 10 Mar 29 09:24 wwn-0x600c0ff0001330db41a6525501000000-part1 -> ../../sdi1
lrwxrwxrwx 1 root root  9 Mar 29 09:24 ata-hp_DVD_D_DS8D3SH_107120293771 -> ../../sr0
lrwxrwxrwx 1 root root 10 Mar 29 09:24 wwn-0x600508b1001cbc12ad6281951ce08eae-part2 ->../../sda2
lrwxrwxrwx 1 root root 10 Mar 29 09:24 scsi-3600508b1001cbc12ad6281951ce08eae-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Mar 29 09:24 wwn-0x600508b1001cbc12ad6281951ce08eae-part5 ->../../sda5
lrwxrwxrwx 1 root root 10 Mar 29 09:24 scsi-3600508b1001cbc12ad6281951ce08eae-part5 -> ../../sda5
lrwxrwxrwx 1 root root 10 Mar 29 09:24 wwn-0x600508b1001cbc12ad6281951ce08eae-part1 ->../../sda1
lrwxrwxrwx 1 root root 10 Mar 29 09:24 scsi-3600508b1001cbc12ad6281951ce08eae-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Mar 29 09:24 wwn-0x600508b1001ccaffb442048c2c296237-part1 ->../../sdb1
lrwxrwxrwx 1 root root 10 Mar 29 09:24 scsi-3600508b1001ccaffb442048c2c296237-part1 -> ../../sdb1
lrwxrwxrwx 1 root root  9 Sep 20 09:16 wwn-0x600508b1001ccaffb442048c2c296237 -> ../../sdb
lrwxrwxrwx 1 root root  9 Sep 20 09:16 scsi-3600508b1001ccaffb442048c2c296237 -> ../../sdb
lrwxrwxrwx 1 root root  9 Sep 20 09:16 wwn-0x600508b1001cbc12ad6281951ce08eae -> ../../sda
lrwxrwxrwx 1 root root  9 Sep 20 09:16 scsi-3600508b1001cbc12ad6281951ce08eae -> ../../sda ```

OR

# ls -ld /sys/block/sd*/device
lrwxrwxrwx 1 root root 0 Mar 29 09:25 /sys/block/sda/device -> ../../../1:0:0:1
lrwxrwxrwx 1 root root 0 Mar 29 09:25 /sys/block/sdb/device -> ../../../1:0:0:2
lrwxrwxrwx 1 root root 0 Mar 29 09:25 /sys/block/sdc/device -> ../../../0:0:0:0
lrwxrwxrwx 1 root root 0 Mar 29 09:25 /sys/block/sdd/device -> ../../../0:0:0:1
lrwxrwxrwx 1 root root 0 Mar 29 09:25 /sys/block/sde/device -> ../../../0:0:0:3
lrwxrwxrwx 1 root root 0 Mar 29 09:25 /sys/block/sdf/device -> ../../../0:0:0:4
lrwxrwxrwx 1 root root 0 Mar 29 09:25 /sys/block/sdg/device -> ../../../4:0:0:0
lrwxrwxrwx 1 root root 0 Mar 29 09:25 /sys/block/sdh/device -> ../../../4:0:0:1
lrwxrwxrwx 1 root root 0 Mar 29 09:25 /sys/block/sdi/device -> ../../../4:0:0:3
lrwxrwxrwx 1 root root 0 Mar 29 09:25 /sys/block/sdj/device -> ../../../4:0:0:4

@PitoneMaledetto
Copy link
Author

Iterate seems a good way of solving the non-existent sgX

@glensc
Copy link
Owner

glensc commented Sep 20, 2016

lsscsi tool is used to detect devices more reliably. try it.

@glensc
Copy link
Owner

glensc commented Sep 20, 2016

also include command whose output you pasted in those ls -l pastes, to see what path you did ls on

@PitoneMaledetto
Copy link
Author

First run:
ls -rtl /dev/disk/by-id/
Second run:
ls -ld /sys/block/sd*/device

@glensc
Copy link
Owner

glensc commented Sep 21, 2016

edited your post. hopefully correctly.

i'm waiting for you to try installing lsscsi tool and see does the plugin work more as expected with the tool present.

@PitoneMaledetto
Copy link
Author

PitoneMaledetto commented Sep 22, 2016

lsscsi --version

version: 0.26  2012/01/31 [svn: r97]

lsscsi -g

[0:0:0:0]    storage HP       P410i            3.66  -          /dev/sg0 
[0:0:0:1]    disk    HP       LOGICAL VOLUME   3.66  /dev/sda   /dev/sg1 
[0:0:0:2]    disk    HP       LOGICAL VOLUME   3.66  /dev/sdb   /dev/sg2 
[1:0:0:0]    cd/dvd  hp       DVD RW AD-7586H  KP03  /dev/sr0   /dev/sg3

sudo ./check_raid -d -p cciss

DEBUG EXEC: /usr/bin/lsscsi -g at ./check_raid line 474.
DEBUG EXEC: >&2 /usr/bin/cciss_vol_status -v at ./check_raid line 470.
DEBUG EXEC: /usr/bin/cciss_vol_status /dev/sg0 at ./check_raid line 474.
Can't locate object method "new" via package "App::Monitoring::Plugin::CheckRaid::Plugins::smartctl" (perhaps you forgot to load "App::Monitoring::Plugin::CheckRaid::Plugins::smartctl"?) at ./check_raid line 1879.

/usr/bin/lsscsi -g

[0:0:0:0]    storage HP       P410i            3.66  -          /dev/sg0 
[0:0:0:1]    disk    HP       LOGICAL VOLUME   3.66  /dev/sda   /dev/sg1 
[0:0:0:2]    disk    HP       LOGICAL VOLUME   3.66  /dev/sdb   /dev/sg2 
[1:0:0:0]    cd/dvd  hp       DVD RW AD-7586H  KP03  /dev/sr0   /dev/sg3

/usr/bin/cciss_vol_status -v

cciss_vol_status version 1.09

sudo /usr/bin/cciss_vol_status /dev/sg0

/dev/sda: (Smart Array P410i) RAID 1 Volume 0 status: OK.   At least one spare drive designated.  At least one spare drive remains available.
/dev/sdb: (Smart Array P410i) RAID 5 Volume 1 status: OK.   At least one spare drive designated.  At least one spare drive remains available.

@PitoneMaledetto
Copy link
Author

PitoneMaledetto commented Sep 26, 2016

ONE MORE

check_raid --version
check_raid 4.0.2

lsscsi --version
version: 0.26 2012/01/31 [svn: r97]

./check_raid -d -p cciss

DEBUG EXEC: /usr/bin/lsscsi -g at ./check_raid line 474.
DEBUG EXEC: >&2 /usr/bin/cciss_vol_status -v at ./check_raid line 470.
DEBUG EXEC: /usr/bin/sudo -A /usr/bin/cciss_vol_status /dev/sg0 at ./check_raid line 474.
Can't locate object method "new" via package "App::Monitoring::Plugin::CheckRaid::Plugins::smartctl" (perhaps you forgot to load "App::Monitoring::Plugin::CheckRaid::Plugins::smartctl"?) at ./check_raid line 1879.

lsscsi -g

[0:0:0:0]    storage HP       P420i            5.42  -          /dev/sg0 
[0:0:0:1]    disk    HP       LOGICAL VOLUME   5.42  /dev/sda   /dev/sg1 
[0:0:0:2]    disk    HP       LOGICAL VOLUME   5.42  /dev/sdb   /dev/sg2 
[2:0:0:0]    cd/dvd  hp       DVD A  DS8ABSH   AHJ4  /dev/sr0   /dev/sg3 

/usr/bin/cciss_vol_status -v
cciss_vol_status version 1.09

/usr/bin/sudo -A /usr/bin/cciss_vol_status /dev/sg0

/dev/sda: (Smart Array P420i) RAID 1 Volume 0 status: OK. 
/dev/sdb: (Smart Array P420i) RAID 1 Volume 1 status: OK.

BUT
/usr/bin/sudo -A /usr/bin/cciss_vol_status /dev/sg1

cciss_vol_status: /dev/sg1: Unknown SCSI device.

AND
/usr/bin/sudo -A /usr/bin/cciss_vol_status /dev/sg2

cciss_vol_status: /dev/sg2: Unknown SCSI device.

THEREFORE
./check_raid -p cciss

Can't locate object method "new" via package "App::Monitoring::Plugin::CheckRaid::Plugins::smartctl" (perhaps you forgot to load "App::Monitoring::Plugin::CheckRaid::Plugins::smartctl"?) at ./check_raid line 1879.

@PitoneMaledetto
Copy link
Author

PitoneMaledetto commented Oct 12, 2016

It seems that when you force the check using the -p flag that the error is triggered.
if:
sudo ./check_raid then:

WARNING: cciss:[/dev/cciss/c0d0(Smart Array P400): Volume 0 (RAID 1): OK, Volume 1 (RAID 5): OK]; dm:[No devices to check]; hpacucli:[Smart Array P400: Array A(OK)[LUN1:OK], Array B(OK)[LUN2:OK]]

which would be the case to ignore dm instead of triggering a WARNING

but if:
sudo ./check_raid -p cciss then:

Can't locate object method "new" via package "App::Monitoring::Plugin::CheckRaid::Plugins::smartctl" (perhaps you forgot to load "App::Monitoring::Plugin::CheckRaid::Plugins::smartctl"?) at ./check_raid line 1879.

the first check without flags used cciss as well as dm and hpacucli but cciss did not fail.

@glensc glensc added the ready label Nov 17, 2016
glensc added a commit that referenced this issue Dec 19, 2016
@glensc
Copy link
Owner

glensc commented Dec 19, 2016

fixed smartctl import, is this sufficient?

glensc added a commit that referenced this issue Dec 19, 2016
@PitoneMaledetto
Copy link
Author

/usr/local/nagios/libexec/./check_raid.pl -V -d

Can't locate App/Monitoring/Plugin/CheckRaid.pm in @INC (you may need to install the App::Monitoring::Plugin::CheckRaid module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.20.2 /usr/local/share/perl/5.20.2 /usr/lib/x86_64-linux-gnu/perl5/5.20 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.20 /usr/share/perl/5.20 /usr/local/lib/site_perl .) at /usr/local/nagios/libexec/./check_raid.pl line 10.
BEGIN failed--compilation aborted at /usr/local/nagios/libexec/./check_raid.pl line 10.

I have also installed libmonitoring-plugin-perl from jessie-backports but still not running....

@glensc
Copy link
Owner

glensc commented Dec 20, 2016

what is /usr/local/nagios/libexec/./check_raid.pl? how did you obtain it?

also the dist version of plugin is self contained!

@PitoneMaledetto
Copy link
Author

ermm I downloaded the new version from the Download button on the code page...
version 4.0.2 works ok:

root@my-nagios-server:/tmp# /usr/local/nagios/libexec/./check_raid -V
check_raid 4.0.2

...self contained means it should not exit with the missing module error...I might be wrong...

@glensc
Copy link
Owner

glensc commented Dec 20, 2016

don't know what is "download button on the code page", no urls given and no screenshots...

instructions from readme:

yes, self contained means it needs just perl engine and the check_raid.pl script

@PitoneMaledetto
Copy link
Author

got it...I will let you know as soon as tested. Thanks

@glensc
Copy link
Owner

glensc commented Dec 26, 2016

released 4.0.5

@glensc glensc closed this as completed Jan 2, 2017
@glensc glensc removed the ready label Jan 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants