OCS Inventory NG Forums

OCS Inventory NG, an OpenSource computer inventory and package deployement system for Windows and Unix

You are not logged in.

#1 2009-06-19 14:38:51

Andre
New member
Registered: 2009-06-19
Posts: 7

Is it possible to exclude hardware from the agent?

I have just started setting up OCS inventory agents on my Linux servers.
The inventory is being registered on the OCS server and everything looks good. Great stuff!

I have only one question:
the virtual (VMware) and hardware (Dell) Linux servers give errors in /var/log/messages (and of course on syslog) during the ocs agent run.
The virtual server messages are:
Jun 18 15:26:13 <servername> kernel: hda: drive_cmd: status=0x51 { DriveReady SeekComplete Error }
Jun 18 15:26:13 <servername> kernel: hda: drive_cmd: error=0x04 { AbortedCommand }
Jun 18 15:26:13 <servername> kernel: ide: failed opcode was: 0xec

And on a physical server:
Jun 18 14:11:46 <servername> kernel: Device sdb not ready.
Jun 18 14:11:46 <servername> kernel: Device sdb not ready.
Jun 18 14:11:49 <servername> kernel: hda: drive_cmd: status=0x51 { DriveReady SeekComplete Error }
Jun 18 14:11:49 <servername> kernel: hda: drive_cmd: error=0x04Aborted Command

In the virtual machine, the drive hda is identified as 'VMware_Virtual_IDE_CDROM_Drive'.
On the physical server the drive sdb is identified as 'VirtualFloppy' and drive hda is 'HLDT-ST DVD-ROM GDR-8084N'.

I have looked, but did not find a way to exclude these devices from being tested.
As there are no problems, I would like the syslog/messages to be as quiet as possible.

Thanks!
Andre

Offline

 

#2 2009-06-19 14:46:15

goneri
FusionInventory Team
From: Paris
Registered: 2007-06-01
Posts: 2265
Website

Re: Is it possible to exclude hardware from the agent?

Hi,

Can you please just check you get this message by doing a "fdisk -s /dev/sdb" ? Do you have the lshal command avalaible?

Cheers

Offline

 

#3 2009-06-19 14:58:48

Andre
New member
Registered: 2009-06-19
Posts: 7

Re: Is it possible to exclude hardware from the agent?

@goneri: thanks for the reply!
Here's the info.

fdisk -s /dev/sdb gives the message 'Unable to open /dev/sdb' but no errors in /var/log/messages.

lshal output for /dev/sdb:
udi = '/org/freedesktop/Hal/devices/block_8_16'
  storage.policy.should_mount = true  (bool)
  info.udi = '/org/freedesktop/Hal/devices/block_8_16'  (string)
  storage.requires_eject = false  (bool)
  storage.hotpluggable = true  (bool)
  storage.removable = true  (bool)
  info.product = 'Virtual  Floppy'  (string)
  info.vendor = 'Dell'  (string)
  storage.drive_type = 'disk'  (string)
  block.storage_device = '/org/freedesktop/Hal/devices/block_8_16'  (string)
  storage.physical_device = '/org/freedesktop/Hal/devices/usb_usb_device_413c_1_0_-1_1028  123456_1'  (string)
  storage.vendor = 'Dell'  (string)
  storage.model = 'Virtual  Floppy'  (string)
  storage.automount_enabled_hint = true  (bool)
  storage.no_partitions_hint = false  (bool)
  storage.media_check_enabled = true  (bool)
  storage.bus = 'usb'  (string)
  block.minor = 16  (0x10)  (int)
  block.major = 8  (0x8)  (int)
  info.capabilities = 'block storage'  (string)
  info.category = 'storage'  (string)
  info.parent = '/org/freedesktop/Hal/devices/scsi_2_0_0_0'  (string)
  block.device = '/dev/sdb'  (string)
  block.is_volume = false  (bool)
  block.have_scanned = false  (bool)
  block.no_partitions = false  (bool)
  linux.sysfs_path_device = '/sys/block/sdb'  (string)
  linux.sysfs_path = '/sys/block/sdb'  (string)
  info.bus = 'block'  (string)

Offline

 

#4 2009-06-19 15:29:51

goneri
FusionInventory Team
From: Paris
Registered: 2007-06-01
Posts: 2265
Website

Re: Is it possible to exclude hardware from the agent?

Ok and this command?:
hdparm -I /dev/sdb

Offline

 

#5 2009-06-19 15:33:31

Andre
New member
Registered: 2009-06-19
Posts: 7

Re: Is it possible to exclude hardware from the agent?

> hdparm -I /dev/sdb

/dev/sdb:
HDIO_DRIVE_CMD(identify) failed: Invalid argument

Again, nothing is written to /var/log/messages

Offline

 

#6 2009-06-19 16:25:22

goneri
FusionInventory Team
From: Paris
Registered: 2007-06-01
Posts: 2265
Website

Re: Is it possible to exclude hardware from the agent?

and?: fdisk -l

Offline

 

#7 2009-06-19 16:34:15

Andre
New member
Registered: 2009-06-19
Posts: 7

Re: Is it possible to exclude hardware from the agent?

> fdisk -l

Disk /dev/sda: 292.3 GB, 292326211584 bytes
255 heads, 63 sectors/track, 35539 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14       35539   285362595   8e  Linux LVM

Disk /dev/sdc: 267.8 GB, 267899633664 bytes
255 heads, 63 sectors/track, 32570 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1       32570   261618493+  83  Linux

Again, nothing is written to /var/log/messages

Offline

 

#8 2009-06-19 16:54:55

goneri
FusionInventory Team
From: Paris
Registered: 2007-06-01
Posts: 2265
Website

Re: Is it possible to exclude hardware from the agent?

Are you sure those error are created during the agent execution?

Offline

 

#9 2009-06-22 12:54:51

Andre
New member
Registered: 2009-06-19
Posts: 7

Re: Is it possible to exclude hardware from the agent?

Yes, but it looks like it only happens when the agent is executed interactively.
So normally I should only see those messages during install, in which case it is something I can live with.

Offline

 

#10 2009-06-22 12:58:03

goneri
FusionInventory Team
From: Paris
Registered: 2007-06-01
Posts: 2265
Website

Re: Is it possible to exclude hardware from the agent?

Only during install o_O Which version of the agent do you install?

Offline

 

#11 2009-06-22 16:30:15

Andre
New member
Registered: 2009-06-19
Posts: 7

Re: Is it possible to exclude hardware from the agent?

> /usr/bin/ocsinventory-agent -v
Ocsinventory unified agent for UNIX and Linux (1.0.1)

Offline

 

#12 2009-06-22 17:17:13

goneri
FusionInventory Team
From: Paris
Registered: 2007-06-01
Posts: 2265
Website

Re: Is it possible to exclude hardware from the agent?

Are you sure you can reproduct the problem?

Offline

 

#13 2009-06-24 14:54:43

Andre
New member
Registered: 2009-06-19
Posts: 7

Re: Is it possible to exclude hardware from the agent?

goneri wrote:

Are you sure you can reproduct the problem?

Yes, when it runs from the cron there is no problem reported, when I interactively run the command '/usr/bin/ocsinventory-agent --lazy' I get the errors:
Jun 24 14:53:04 <server> kernel: Device sdb not ready.
Jun 24 14:53:04 <server> kernel: Device sdb not ready.
Jun 24 14:53:07 <server> kernel: hda: drive_cmd: status=0x51 { DriveReady SeekComplete Error }
Jun 24 14:53:07 <server> kernel: hda: drive_cmd: error=0x04Aborted Command

Offline

 

#14 2009-07-19 18:38:30

Xero
New member
Registered: 2009-07-19
Posts: 2

Re: Is it possible to exclude hardware from the agent?

We've had this same exact issue on all of our CentOS machines. It seems to happen on older systems which do not use the libata driver for the CDROM/DVDROM. On any server with a kernel >=2.6.20 or  with cdroms that show up as "/dev/sd*" or "/dev/sr*" devices, this doesn't seem to happen. We've also suspected OCS of causing some instability on a few of our HP machines which run the hp raid querying utilities, so I would also be interested in the ability to disable certain things in OCS. We've had these boxes reboot seemingly randomly, until we noticed the reboot time possibly correlates with the OCS cronjob which is a bit concerning. We've reduced the frequency that we run the agent due to this.

Also, this happens for us regardless of whether OCS is ran from cron or not, but it definitely corresponds to OCS. It actually scared us a bit at first since we thought it might have been a bad hard drive until realizing it was the cdrom. It would definitely be nice to at least make things a lot quieter.

Offline

 

#15 2009-07-22 11:08:47

goneri
FusionInventory Team
From: Paris
Registered: 2007-06-01
Posts: 2265
Website

Re: Is it possible to exclude hardware from the agent?

Hi,

All the collect modules are in lib/Ocsinventory/Agent/Backend. You can drop some of them if needed. I'm very interested by the HP issue.  It's probably this module: lib/Ocsinventory/Agent/Backend/OS/Linux/Storages/HP.pm. But it has only some hpacucli call.

Offline

 

#16 2009-07-24 16:11:10

Xero
New member
Registered: 2009-07-19
Posts: 2

Re: Is it possible to exclude hardware from the agent?

In regards to the hp issue, the server in question is an hp dl585 with 2 raid controllers, a p400 which handles the 8 internal drives and a p800 which has 4 external arrays with 100 drives total. The p800 does not seem to get inventoried at all. I've noticed OCS taking quite a long time to run on these servers, doing a "ps faux" while running it shows it running tons of hp commands one after another. I'm afraid that there's some kind of bug in the HP utilities and/or the hardware that is causing problems with querying this stuff repetitively. We have 2 such servers, one of which acts as a hot-standby to the other. Currently only the standby server is running OCS as having the main server go down is very, very bad.

Offline

 

#17 2009-07-28 19:37:41

goneri
FusionInventory Team
From: Paris
Registered: 2007-06-01
Posts: 2265
Website

Re: Is it possible to exclude hardware from the agent?

Sure I understand sad
OCS only run some very simple command. It would be great if you can identify which one trigger the problem.

Offline

 

#18 2009-08-03 15:52:13

4ngel
New member
Registered: 2009-08-03
Posts: 8

Re: Is it possible to exclude hardware from the agent?

Hi all,
the problem is generated when the command
hdparm -I /dev/xxx
is started on a IDE ATAPI device like a CDROM.
The module of OCS interested by the issue is Storages.pm
This issue is well known on hdparm. Look at http://www.mail-archive.com/debian-bugs … 96279.html
I am trying to write a piece of code that understand if the device is an ATAPI one in order to avoid starting hdparm on it.
The funny thing is that hdparm gives you the correct information BUT it gaves also a kernel message because "hdparm doesn't "know" what kind of device it is talking to,
so it first tries "IDENTIFY" (which works only for hard disks) and then if that fails it tries "PACKET_IDENTIFY" (which works only for ATAPI devices)":

Example:

hdparm -I /dev/cdrom

/dev/cdrom:

ATAPI CD-ROM, with removable media
    Model Number:       HL-DT-STDVD-ROM GDR-T10N               
    Serial Number:     
    Firmware Revision:  1.05   
Standards:
    Likely used CD-ROM ATAPI-1
Configuration:
    DRQ response: 50us.
    Packet size: 12 bytes
Capabilities:
    LBA, IORDY(can be disabled)
    DMA: sdma0 sdma1 sdma2 mdma0 mdma1 mdma2 udma0 udma1 *udma2
         Cycle time: min=120ns recommended=120ns
    PIO: pio0 pio1 pio2 pio3 pio4
         Cycle time: no flow control=120ns  IORDY flow control=120ns
HW reset results:
    CBLID- below Vih
    Device num = 0 determined by CSEL

Error:

hda: drive_cmd: status=0x51 { DriveReady SeekComplete Error }
hda: drive_cmd: error=0x04 { AbortedCommand }
ide: failed opcode was: 0xec

Offline

 

#19 2009-08-03 16:44:04

goneri
FusionInventory Team
From: Paris
Registered: 2007-06-01
Posts: 2265
Website

Re: Is it possible to exclude hardware from the agent?

Offline

 

#20 2009-08-03 18:38:06

4ngel
New member
Registered: 2009-08-03
Posts: 8

Re: Is it possible to exclude hardware from the agent?

Thank you Goneri smile

Offline

 

#21 2009-08-04 10:31:51

4ngel
New member
Registered: 2009-08-03
Posts: 8

Re: Is it possible to exclude hardware from the agent?

Hi Goneri,
I am using the new Storages.pm but I have this error on some server:

[debug] runWithTimeout(): unexpected error: Can't use an undefined value as a HASH reference at /opt/OClientS/lib/perl5/site_perl/5.8.0/Ocsinventory/Agent/Backend/OS/Linux/Storages.pm line 201, <MEMINFO> line 32.

The Storages.pm doesn't generate output.
Any idea?

Offline

 

#22 2009-08-04 11:12:08

4ngel
New member
Registered: 2009-08-03
Posts: 8

Re: Is it possible to exclude hardware from the agent?

Hi Goneri,
I have seen the previous problem is the use of an old version of smartctl on those servers. On other servers it runs ok.
But using only smartctl you have a less detailed output on the inventory:

hdparm
sda           PERC_5i      SCSI      disk      71041      60019b90d0c6f7000e0188d471453957      1.03

smartctl
                  DELL          IDE      disk      71041      360019b90d0c6f7000e0188d471453957


Probably you could add only an "if" inside the hdparm code in order to exclude only the hd* devices (usually IDE) and pass them to smartctl.
What do you think?

Offline

 

#23 2009-08-04 11:48:28

goneri
FusionInventory Team
From: Paris
Registered: 2007-06-01
Posts: 2265
Website

Re: Is it possible to exclude hardware from the agent?

I fixed the error you pointed out. Thanks again for your feedbacks. For the smartctl, we run it with the -i flag. So I don't think it's a real issue.

Cheers

Offline

 

#24 2009-08-04 12:31:10

4ngel
New member
Registered: 2009-08-03
Posts: 8

Re: Is it possible to exclude hardware from the agent?

Hi Goneri,
another thing.

The version 9.22 of hdparm doesn't have the issue described yesterday and manages correctly the error on ATAPI devices.

hdparm -V
hdparm v9.22

hdparm -I /dev/cdrom
/dev/cdrom:
HDIO_DRIVE_CMD(identify) failed: Invalid exchange

No error on dmesg.

Last edited by 4ngel (2009-08-04 12:34:10)

Offline

 

#25 2009-08-04 12:47:08

goneri
FusionInventory Team
From: Paris
Registered: 2007-06-01
Posts: 2265
Website

Re: Is it possible to exclude hardware from the agent?

Oh oh! I commited a function to detect if it's a buggy hdparm or not. Can you check the new Storages.pm

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson

Hosted by: Serveurs dedies Conseil et infogerance Ocs on sf.net