Re: [Nut-upsuser] Where is nut-scanner on raspberry pi?

2022-08-14 Thread Jim Klimov via Nut-upsuser
Posted https://github.com/networkupstools/nut/issues/1560 lest we forget :)

Jim

On Sun, Aug 14, 2022, 02:06 Jim Klimov  wrote:

> Haven't poked INSTALL.nut for a while, PRs welcome. And there were many
> bite-size PR ideas in this thread ;)
>
> There was quite a bit of details poured into docs/config-prereqs.txt that
> grew along with CI farm over the past year or two, so covers many OSes
> (even Windows, it its branch).
>
> From my stunt at packaging NUT for some in-house stuff and researching
> others' work, the approach I saw often was to `configure --with-all` and
> add `--without-something` for components utterly missing on a particular
> OS. Then the resulting binaries are assigned to this or that package to
> group drivers by dependencies, clients, tools, etc.
>
> The help text posted above seems to be from a system that lacks shared
> net-snmp, libusb, etc. which nut-scanner loads dynamically by design of its
> era, so it could be bundled freely and without impacting the binary file by
> strict links to shared objects. Worked for you in fact - libraries missing
> but tool does run for other protocols. A downside is dependency on lib file
> naming and location (master may be more flexible in that since last week's
> PRs).
>
> On Thu, Aug 11, 2022, 17:55 Greg Troxel  wrote:
>
>>
>> It turns out that there is a bug in nut about this, in 2.8.0.
>>
>> I checked the pkgsrc package, and it doesn't have nut-scanner.  Usually
>> what is packaged is what upstream installs.  On digging in, I found that
>> the package did not declare a dependency on libltldl and thus it was not
>> visibile during the build, and nut-scanner was not built.
>>
>> The first bug is that this is not documented in INSTALL.nut.  If it
>> were, it would be a package bug not to provide it.  It is sort of hinted
>> at that somehwere else there is a list of prereqs, and I eventually
>> found them, but I think "this is what you need installed to build", even
>> if a pointer, should be front and center in a really-hard-to-miss way.
>> And, there is a huge list of per-OS, without first things being
>> described in terms of upstream package names in an
>> OS/distribution-agnostic manner.
>>
>> The second bug is that the nut-scanner man page is installed even if
>> nut-scanner is not built.  Probably the fix is to move man pages to be
>> with their programs so docs/code match, but that is surely a can of
>> worms and just conditionalizing it in the Makefile.am the same way that
>> the nut-scanner subdir is conditionalized is reasonable.
>>
>> I changed pkgsrc to depend on libltldl and now I get nut-scanner.  I'll
>> likely commit that change.  But, the main nut package does not use usb,
>> and I haven't figured out how that works with the usb split package.
>>
>> (I am not meaning to assert that nut-scanner does or does not belong as
>> default or that users should or should not use it.)
>>
>> The nut-scanner I got doesn't seem that useful:
>>
>>   OPTIONS:
>> -C, --complete_scan: Scan all available devices except serial ports
>> (default).
>>   * Options for USB devices scan not enabled: library not detected.
>>   * Options for SNMP devices scan not enabled: library not detected.
>>   * Options for XML/HTTP devices scan not enabled: library not detected.
>> -O, --oldnut_scan: Scan NUT devices (old method).
>>   * Options for NUT devices (avahi method) scan not enabled: library not
>> detected.
>>   * Options for IPMI devices scan not enabled: library not detected.
>> -E, --eaton_serial : Scan serial Eaton devices
>> (XCP, SHUT and Q1).
>> -T, --thread : Limit the amount of scanning
>> threads running simultaneously (not implemented in this build: no pthread
>> support)
>> ___
>> Nut-upsuser mailing list
>> Nut-upsuser@alioth-lists.debian.net
>> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser
>>
>
___
Nut-upsuser mailing list
Nut-upsuser@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] Where is nut-scanner on raspberry pi?

2022-08-13 Thread Jim Klimov via Nut-upsuser
Haven't poked INSTALL.nut for a while, PRs welcome. And there were many
bite-size PR ideas in this thread ;)

There was quite a bit of details poured into docs/config-prereqs.txt that
grew along with CI farm over the past year or two, so covers many OSes
(even Windows, it its branch).

>From my stunt at packaging NUT for some in-house stuff and researching
others' work, the approach I saw often was to `configure --with-all` and
add `--without-something` for components utterly missing on a particular
OS. Then the resulting binaries are assigned to this or that package to
group drivers by dependencies, clients, tools, etc.

The help text posted above seems to be from a system that lacks shared
net-snmp, libusb, etc. which nut-scanner loads dynamically by design of its
era, so it could be bundled freely and without impacting the binary file by
strict links to shared objects. Worked for you in fact - libraries missing
but tool does run for other protocols. A downside is dependency on lib file
naming and location (master may be more flexible in that since last week's
PRs).

On Thu, Aug 11, 2022, 17:55 Greg Troxel  wrote:

>
> It turns out that there is a bug in nut about this, in 2.8.0.
>
> I checked the pkgsrc package, and it doesn't have nut-scanner.  Usually
> what is packaged is what upstream installs.  On digging in, I found that
> the package did not declare a dependency on libltldl and thus it was not
> visibile during the build, and nut-scanner was not built.
>
> The first bug is that this is not documented in INSTALL.nut.  If it
> were, it would be a package bug not to provide it.  It is sort of hinted
> at that somehwere else there is a list of prereqs, and I eventually
> found them, but I think "this is what you need installed to build", even
> if a pointer, should be front and center in a really-hard-to-miss way.
> And, there is a huge list of per-OS, without first things being
> described in terms of upstream package names in an
> OS/distribution-agnostic manner.
>
> The second bug is that the nut-scanner man page is installed even if
> nut-scanner is not built.  Probably the fix is to move man pages to be
> with their programs so docs/code match, but that is surely a can of
> worms and just conditionalizing it in the Makefile.am the same way that
> the nut-scanner subdir is conditionalized is reasonable.
>
> I changed pkgsrc to depend on libltldl and now I get nut-scanner.  I'll
> likely commit that change.  But, the main nut package does not use usb,
> and I haven't figured out how that works with the usb split package.
>
> (I am not meaning to assert that nut-scanner does or does not belong as
> default or that users should or should not use it.)
>
> The nut-scanner I got doesn't seem that useful:
>
>   OPTIONS:
> -C, --complete_scan: Scan all available devices except serial ports
> (default).
>   * Options for USB devices scan not enabled: library not detected.
>   * Options for SNMP devices scan not enabled: library not detected.
>   * Options for XML/HTTP devices scan not enabled: library not detected.
> -O, --oldnut_scan: Scan NUT devices (old method).
>   * Options for NUT devices (avahi method) scan not enabled: library not
> detected.
>   * Options for IPMI devices scan not enabled: library not detected.
> -E, --eaton_serial : Scan serial Eaton devices
> (XCP, SHUT and Q1).
> -T, --thread : Limit the amount of scanning
> threads running simultaneously (not implemented in this build: no pthread
> support)
> ___
> Nut-upsuser mailing list
> Nut-upsuser@alioth-lists.debian.net
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser
>
___
Nut-upsuser mailing list
Nut-upsuser@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] Where is nut-scanner on raspberry pi?

2022-08-11 Thread Greg Troxel

It turns out that there is a bug in nut about this, in 2.8.0.

I checked the pkgsrc package, and it doesn't have nut-scanner.  Usually
what is packaged is what upstream installs.  On digging in, I found that
the package did not declare a dependency on libltldl and thus it was not
visibile during the build, and nut-scanner was not built.

The first bug is that this is not documented in INSTALL.nut.  If it
were, it would be a package bug not to provide it.  It is sort of hinted
at that somehwere else there is a list of prereqs, and I eventually
found them, but I think "this is what you need installed to build", even
if a pointer, should be front and center in a really-hard-to-miss way.
And, there is a huge list of per-OS, without first things being
described in terms of upstream package names in an
OS/distribution-agnostic manner.

The second bug is that the nut-scanner man page is installed even if
nut-scanner is not built.  Probably the fix is to move man pages to be
with their programs so docs/code match, but that is surely a can of
worms and just conditionalizing it in the Makefile.am the same way that
the nut-scanner subdir is conditionalized is reasonable.

I changed pkgsrc to depend on libltldl and now I get nut-scanner.  I'll
likely commit that change.  But, the main nut package does not use usb,
and I haven't figured out how that works with the usb split package.

(I am not meaning to assert that nut-scanner does or does not belong as
default or that users should or should not use it.)

The nut-scanner I got doesn't seem that useful:

  OPTIONS:
-C, --complete_scan: Scan all available devices except serial ports 
(default).
  * Options for USB devices scan not enabled: library not detected.
  * Options for SNMP devices scan not enabled: library not detected.
  * Options for XML/HTTP devices scan not enabled: library not detected.
-O, --oldnut_scan: Scan NUT devices (old method).
  * Options for NUT devices (avahi method) scan not enabled: library not 
detected.
  * Options for IPMI devices scan not enabled: library not detected.
-E, --eaton_serial : Scan serial Eaton devices (XCP, 
SHUT and Q1).
-T, --thread : Limit the amount of scanning threads 
running simultaneously (not implemented in this build: no pthread support)


signature.asc
Description: PGP signature
___
Nut-upsuser mailing list
Nut-upsuser@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] Where is nut-scanner on raspberry pi?

2022-08-11 Thread Greg Troxel

華敏 座利 via Nut-upsuser  writes:

> Thanks, I'll check it out. Still would like to know why the documentation
> shows there should be a nut-scanner and it doesn't install on raspb o/s.
> But I do appreciate the tips on how to find what I need now. Thank you
> again !

You are having two problems:

  Your distribution is very old.  Generally, projects do not support old
  versions just because some old distribution has them.  I have no
  formal standing in nut, but in places where I do, I say "bug reports
  are accepted only against the latest formal release or the tip of
  master".  If you are running old code you should get support from the
  packaging system that provides old code.
[However, Debian 11 has ups-nut 2.74.]

  It seems that Debian's nut package doesn't install nut-scanner.  If
  that's because the default build installs it, but they chose not to,
  that is an issue you have with them and it would be appropriate to
  file a Debian bug.  But there might be a ups-nut-scanner package that
  has that separately.  And if the default build doesn't install it for
  some reason, that's an actual ups-nut issue.

Note that it also might be that you are running such an old version of
nut that nut-scanner wasn't included but probably not.  But probably not.

Note also that you can't use the current up-to-date nut documentation
about old versions and expect it to be right.  You need to use the same
version of docs.



signature.asc
Description: PGP signature
___
Nut-upsuser mailing list
Nut-upsuser@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] Where is nut-scanner on raspberry pi?

2022-08-11 Thread 華敏 座利 via Nut-upsuser
Thanks, I'll check it out. Still would like to know why the documentation
shows there should be a nut-scanner and it doesn't install on raspb o/s.
But I do appreciate the tips on how to find what I need now. Thank you
again !
___
Nut-upsuser mailing list
Nut-upsuser@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] Where is nut-scanner on raspberry pi?

2022-08-11 Thread Charles Lepple via Nut-upsuser

> On Aug 11, 2022, at 8:03 AM, z.kevino--- via Nut-upsuser wrote:
> 
> So even with Buster I get the same results - no nut-scanner. I was under the 
> impression that it was needed to get the serial # of an APC device. I have 
> two of the same type of devices (APC UPS) and the vendor code and product 
> code are the same for them, so I didn’t know how to distinguish one from the 
> other in the config files.
> 
The serial number is shown in dmesg:

[7.337934] usb 6-2: New USB device found, idVendor=051d, idProduct=0003
[7.337935] usb 6-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[7.337936] usb 6-2: Product: Smart-UPS C 1000 FW:UPS 10.0 / ID=1005
[7.337937] usb 6-2: Manufacturer: American Power Conversion 
[7.337938] usb 6-2: SerialNumber: 3S1746X05384  

or you can retrieve it with lsusb:

$ sudo lsusb -d 51d: -v | grep -2 iSerial
  iManufacturer   1 American Power Conversion 
  iProduct2 Smart-UPS C 1000 FW:UPS 10.0 / ID=1005
  iSerial 3 3S1746X05384  
  bNumConfigurations  1
  Configuration Descriptor:

(examples from Ubuntu; formatting may vary slightly. the "lsusb -d 51d:" flag 
filters for APC's vendor ID.)

# ups.conf
[apc]
driver = usbhid-ups
port = auto
serial = "3S1746X05384"
desc = "Basement"

-- 
Charles Lepple
clepple@gmail



___
Nut-upsuser mailing list
Nut-upsuser@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] Where is nut-scanner on raspberry pi?

2022-08-11 Thread z.kevino--- via Nut-upsuser
So even with Buster I get the same results - no nut-scanner. I was under the 
impression that it was needed to get the serial # of an APC device. I have two 
of the same type of devices (APC UPS) and the vendor code and product code are 
the same for them, so I didn’t know how to distinguish one from the other in 
the config files.



-

The problem with the world is that the intelligent people are full of doubts, 
while the stupid ones are full of confidence.

> On Aug 10, 2022, at 21:05, z.kev...@gmail.com wrote:
> 
> 
> pi@DMRraspPi:~ $ cat /etc/os-release
> PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
> NAME="Raspbian GNU/Linux"
> VERSION_ID="9"
> VERSION="9 (stretch)"
> VERSION_CODENAME=stretch
> ID=raspbian
> ID_LIKE=debian
> HOME_URL="http://www.raspbian.org/;
> SUPPORT_URL="http://www.raspbian.org/RaspbianForums;
> BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs;
> 
> 
> nut is already the newest version (2.7.4-5).
> nut-client is already the newest version (2.7.4-5+b1).
> nut-server is already the newest version (2.7.4-5+b1).
> 
> -
> 
> The problem with the world is that the intelligent people are full of doubts, 
> while the stupid ones are full of confidence.
> 
>>> On Aug 10, 2022, at 10:46, Kevin Zari  wrote:
>>> 
>> Just get conman not found. Quick google search finds others with same 
>> issue.  On raspberry pi 3b. 
>> 
>> -
>> The problem with the world is that the intelligent people are full of 
>> doubts, while the stupid ones are full of confidence.
___
Nut-upsuser mailing list
Nut-upsuser@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] Where is nut-scanner on raspberry pi?

2022-08-10 Thread Charles Lepple via Nut-upsuser
On Aug 10, 2022, at 9:05 PM, z.kevino--- via Nut-upsuser 
 wrote:
> 
> VERSION="9 (stretch)"
> VERSION_CODENAME=stretch
> 
stretch is getting pretty old now - 
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=921379 appears to have been 
fixed in 2019. The output of nut-scanner should mostly be portable (besides any 
bus-specific numbering), so if you really need nut-scanner, it should be 
possible to find another distro (e.g. Linux live CD/USB; probably most recent 
version of Ubuntu would suffice) and run it on a PC.

On the other hand, while I guess nut-scanner is useful for some, I have seen 
nothing but headaches from the developer perspective (it is very sensitive to 
the exact library paths, which vary based on distro and architecture). Unless 
you are dealing with more than one or two UPS units, it will probably be 
quicker to describe the UPS and its connection method (USB/serial/network) to 
this list, and have someone generate a configuration file by hand.

For the common USB case, the ups.conf syntax is straightforward and 
well-documented: 
https://networkupstools.org/docs/man/usbhid-ups.html#_implementation
___
Nut-upsuser mailing list
Nut-upsuser@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] Where is nut-scanner on raspberry pi?

2022-08-10 Thread z.kevino--- via Nut-upsuser
pi@DMRraspPi:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
VERSION_CODENAME=stretch
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/;
SUPPORT_URL="http://www.raspbian.org/RaspbianForums;
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs;


nut is already the newest version (2.7.4-5).
nut-client is already the newest version (2.7.4-5+b1).
nut-server is already the newest version (2.7.4-5+b1).

-

The problem with the world is that the intelligent people are full of doubts, 
while the stupid ones are full of confidence.

> On Aug 10, 2022, at 10:46, Kevin Zari  wrote:
> 
> Just get conman not found. Quick google search finds others with same issue. 
>  On raspberry pi 3b. 
> 
> -
> The problem with the world is that the intelligent people are full of doubts, 
> while the stupid ones are full of confidence.
___
Nut-upsuser mailing list
Nut-upsuser@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] Where is nut-scanner on raspberry pi?

2022-08-10 Thread Kevin P. Fleming
The locations of tools are controlled by the Linux distribution you
are using and the packages you have installed, not by the hardware
platform.

Please reply to the list indication which Linux distribution you are
using and which NUT-related packages you have installed.

On Wed, Aug 10, 2022 at 11:10 AM Kevin Zari via Nut-upsuser
 wrote:
>
> Just get conman not found. Quick google search finds others with same issue.  
> On raspberry pi 3b.
>
> -
> The problem with the world is that the intelligent people are full of doubts, 
> while the stupid ones are full of confidence.
> ___
> Nut-upsuser mailing list
> Nut-upsuser@alioth-lists.debian.net
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser

___
Nut-upsuser mailing list
Nut-upsuser@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser


[Nut-upsuser] Where is nut-scanner on raspberry pi?

2022-08-10 Thread Kevin Zari via Nut-upsuser
Just get conman not found. Quick google search finds others with same issue.  
On raspberry pi 3b. 

-
The problem with the world is that the intelligent people are full of doubts, 
while the stupid ones are full of confidence.___
Nut-upsuser mailing list
Nut-upsuser@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser