Marcello Vezzelli
2014-Aug-14 07:55 UTC
[Nut-upsuser] multiple identical UPS on same server
On 13/08/2014 16:27, Charles Lepple wrote:>> The blew one had the serial number, so I'm left with two different UPSes >> from the serial number point of view. >> I wonder if an empty serial number is a valid serial number! > I haven't tried it, but an empty string (that is, iSerial is not zero, > but the string has length zero) should match the regex "".I've found another strange issue that prevented me to test this solution. VMware ESXi is filtering out serial number information, together with iManufacturer and iProduct. This is from lsusb -v done from server host: Bus 02 Device 07: ID 0665:5161 Cypress Semiconductor USB to Serial Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x0665 Cypress Semiconductor idProduct 0x5161 USB to Serial bcdDevice 0.02 iManufacturer 1 INNO TECH iProduct 2 USB to Serial iSerial 3 20100813 bNumConfigurations 1 This is from lsusb -v done inside virtual server: Bus 002 Device 004: ID 0665:5161 Cypress Semiconductor USB to Serial Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x0665 Cypress Semiconductor idProduct 0x5161 USB to Serial bcdDevice 0.02 iManufacturer 1 iProduct 2 iSerial 3 bNumConfigurations 1 At this point I'm stuck again. To support devices connected to VMware virtual servers some extra identifier is needed. Serial number won't work even if it is different. Thanks for your help. -- Marcello Vezzelli Software Development Department E-Works s.r.l. tel. +39 059 2929081 (ext 18) fax +39 059 2925035 via G. Di Vittorio, 28 41011 Campogalliano (MO) - Italy web: http://www.e-works.it meeting room: http://team.e-works.com/join/m.vezzelli at e-works.it ------------------------------------------------------------------------ Avvertenze ai sensi del D.Lgs.196 del 30/06/2003 Le informazioni contenute in questo messaggio di posta elettronica e/o files allegati, sono da considerarsi strettamente riservati. Il loro utilizzo ? consentito esclusivamente al destinatario del messaggio, per le finalit? indicate nello stesso. Costituisce violazione ai principi dettati dal D.Lgs. 196/2003: trattenere il messaggio stesso oltre il tempo necessario, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo od utilizzarlo per finalit? diverse. Ricordiamo che in ogni momento potrete richiederci la sospensione da parte nostra dell'impiego dei vostri dati, ad esclusione delle comunicazioni effettuate in esecuzione di obblighi di legge. Qualora riceveste questo messaggio senza esserne il destinatario Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema ------------------------------------------------------------------------ This e-mail (including attachments) is intended only for the recipient(s) named above. It may contain confidential or privileged information and should not be read, copied or otherwise used by any other person. If you are not the named recipient, please contact the sender immediately and delete the e-mail from your system. ------------------------------------------------------------------------
On Thu, Aug 14, 2014 at 3:55 AM, Marcello Vezzelli <m.vezzelli at e-works.it> wrote:> I've found another strange issue that prevented me to test this solution. > VMware ESXi is filtering out serial number information, together with > iManufacturer and iProduct.Is it a permissions issue? The NUT udev configuration file changes the ownership and permissions to allow the NUT system user to write to the UPS without root permissions, but it might also mean that you would need to run lsusb as that user (or root). Reading USB string descriptors requires sending a control message to the USB device. Reading the device descriptor usually means getting a cached copy from the kernel.
Marcello Vezzelli
2014-Aug-14 13:14 UTC
[Nut-upsuser] multiple identical UPS on same server
On 14/08/2014 14:51, Charles Lepple wrote:> On Thu, Aug 14, 2014 at 3:55 AM, Marcello Vezzelli > <m.vezzelli at e-works.it> wrote: >> I've found another strange issue that prevented me to test this solution. >> VMware ESXi is filtering out serial number information, together with >> iManufacturer and iProduct. > Is it a permissions issue? The NUT udev configuration file changes the > ownership and permissions to allow the NUT system user to write to the > UPS without root permissions, but it might also mean that you would > need to run lsusb as that user (or root).You're definitely right. Thanks for your hint. sudo lsusb -v gives the correct output on virtual server too. Now, one UPS gives iProduct 2 USB to Serial iSerial 3 20100813 while the other iProduct 2 USB to Serial iSerial 0 So I modified ups.conf like this: [sweex2] driver = blazer_usb port = auto runtimecal = 1100,100,2200,50 bus = 002 serial = "20100813" [sweex3] driver = blazer_usb port = auto runtimecal = 1100,100,2200,50 bus = 002 serial = "" If I run (as root) blazer_usb -a sweex2 it works. I get this: Broadcast Message from nut at nagi (somewhere) at 15:08 ... Communications with UPS sweex2 at localhost established But if I restart ups-monitor service or reboot the server, sweex2 stop responding. Broadcast Message from nut at nagi (somewhere) at 15:09 ... UPS sweex2 at localhost is unavailable I'm puzzled. regards -- Marcello Vezzelli Software Development Department E-Works s.r.l. tel. +39 059 2929081 (ext 18) fax +39 059 2925035 via G. Di Vittorio, 28 41011 Campogalliano (MO) - Italy web: http://www.e-works.it meeting room: http://team.e-works.com/join/m.vezzelli at e-works.it ------------------------------------------------------------------------ Avvertenze ai sensi del D.Lgs.196 del 30/06/2003 Le informazioni contenute in questo messaggio di posta elettronica e/o files allegati, sono da considerarsi strettamente riservati. Il loro utilizzo ? consentito esclusivamente al destinatario del messaggio, per le finalit? indicate nello stesso. Costituisce violazione ai principi dettati dal D.Lgs. 196/2003: trattenere il messaggio stesso oltre il tempo necessario, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo od utilizzarlo per finalit? diverse. Ricordiamo che in ogni momento potrete richiederci la sospensione da parte nostra dell'impiego dei vostri dati, ad esclusione delle comunicazioni effettuate in esecuzione di obblighi di legge. Qualora riceveste questo messaggio senza esserne il destinatario Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema ------------------------------------------------------------------------ This e-mail (including attachments) is intended only for the recipient(s) named above. It may contain confidential or privileged information and should not be read, copied or otherwise used by any other person. If you are not the named recipient, please contact the sender immediately and delete the e-mail from your system. ------------------------------------------------------------------------