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

PyNUT "ListClients" method does not work #549

Closed
2 tasks
clepple opened this issue Apr 13, 2018 · 2 comments
Closed
2 tasks

PyNUT "ListClients" method does not work #549

clepple opened this issue Apr 13, 2018 · 2 comments
Milestone

Comments

@clepple
Copy link
Member

clepple commented Apr 13, 2018

There seem to be a few related bugs in the PyNUT ListClients method, as of module version 1.3.0 (NUT 2.7.4+). The symptom is ERR INVALID-ARGUMENT.

  • The command is LIST CLIENT +ups (no "S" at the end of "CLIENT")
  • The "BEGIN" response includes the UPS name

Not sure if there are others.

@clepple clepple added the bug label Apr 13, 2018
@redtripleAAA
Copy link

In the meantime I figured out away to report NUT client by simply running nestat to check connected/established connections

For count:

root@raspberrypi:/etc/nut# netstat -anp | grep :3493 | grep ESTABLISHED | wc -l
4

.
.
.
.

For details:

root@raspberrypi:/etc/nut# netstat -anp | grep :3493 | grep ESTABLISHED
tcp        0      0 127.0.0.1:3493          127.0.0.1:35496         ESTABLISHED 1896/upsd
tcp        0      0 127.0.0.1:35496         127.0.0.1:3493          ESTABLISHED 1910/upsmon
tcp        0      0 10.0.3.37:3493          10.0.12.201:46964       ESTABLISHED 1896/upsd
tcp        0      0 10.0.3.37:3493          10.0.3.16:60548         ESTABLISHED 1896/upsd          

@jimklimov jimklimov added this to the 2.8.1 milestone Jul 27, 2022
@jimklimov
Copy link
Member

jimklimov commented Jul 27, 2022

Note that in the example above you account localhost twice (as server and as client). Technically that grep expression could also match e.g. port 34935.

Posting and testing a PR for PyNUT, to query the data server for its perspective, could be helpful though :)

Possibly extending the new (currently somewhat messy) tests/NIT/nit.sh to set up a sandbox with client(s) attached and listing those - the bug could be caught (and fix confirmed) this way...

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

3 participants