Closed lapsio closed 8 years ago
Hi again,
Thank you for testing the new version and thank you for your comments!! I had a first look on it:
.networkInterfaces
.... well yes I am relying on node.js os.networkInterfaces()
, very interesting that this does not return all interfaces ... so this is something we should handle over to the node.js group?? Btw, on my machines I get the same results with os.networkInterfaces()
and ip link list
(or ip address
). .users
--> empty list: the problem here might be the who
command (respectively the options). So there is obviously a bug in my approach! Can you provide me 3 things:
--> output of who --version
--> output of who --help
--> which OS / distro you are working with?
I will then work on an workarround!
Thank you in advance!.services
returning "nothing" when you don't provide srv variable: hmmmm, it should then return an empty array (and as far as I see, it does exactly that). What would be your suggestion here?Thank you for your support!
Hi again, some more details concerning your comments/bug report:
.networkInterfaces
: In the nodejs docs, I found this:
"The os.networkInterfaces()
method returns an object containing only network interfaces that have been assigned a network address."
So here it seems, that in your case, eno1
has not yet an assigned network address.
I need to think, if I can write a better solution (not relying on os.networkInterfaces()
). Please give me some time to think about that.users
: I am already working on a solution but I am not sure if that works.
It would be nice to get some details to verify, if this could work:
--> output of who; echo '---'; w | tail -n +2
--> output of uname -a
(to be more sure, what type of OS is not working with the current version)Thank you in advance!
oh sorry I saw previous message but forgot to reply.
my OS:
> sys.osInfo(function(s){console.log(s)})
Promise { <pending> }
> { platform: 'Linux',
distro: 'openSUSE',
release: '13.2',
codename: '',
kernel: '4.6.4-1-default',
arch: 'x64',
hostname: 'linux-qzuq',
logofile: 'opensuse' }
lapsio@linux-qzuq ~> uname -a
Linux linux-qzuq 4.6.4-1-default #1 SMP PREEMPT Mon Jul 11 17:59:12 UTC 2016 (103c936) x86_64 x86_64 x86_64 GNU/Linux
(older OpenSUSE 13.2 with Tumbleweed kernel and some other critical packages) Most of my machines are running various versions of OpenSUSE mostly 13.2 with some modifications. Also there's one Arch machine but I haven't tested this lib on it yet
who
lapsio@linux-qzuq ~> who --version
who (GNU coreutils) 8.23
lapsio@linux-qzuq ~> who --help
Usage: who [OPTION]... [ FILE | ARG1 ARG2 ]
Print information about users who are currently logged in.
-a, --all same as -b -d --login -p -r -t -T -u
-b, --boot time of last system boot
-d, --dead print dead processes
-H, --heading print line of column headings
-l, --login print system login processes
--lookup attempt to canonicalize hostnames via DNS
-m only hostname and user associated with stdin
-p, --process print active processes spawned by init
-q, --count all login names and number of users logged on
-r, --runlevel print current runlevel
-s, --short print only name, line, and time (default)
-t, --time print last system clock change
-T, -w, --mesg add user's message status as +, - or ?
-u, --users list users logged in
--message same as -T
--writable same as -T
--help display this help and exit
--version output version information and exit
If FILE is not specified, use /var/run/utmp. /var/log/wtmp as FILE is common.
If ARG1 ARG2 given, -m presumed: 'am i' or 'mom likes' are usual.
GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
For complete documentation, run: info '(coreutils) who invocation'
about services. Well idk systemctl status
without giving any service just shows status of all services active and running on system. I think that's the reason I expected similar behavior.
about 5.
I meant that I followed code to figure out what are those -1
values and I came to conclusion that condition required for them to be set to something else than -1
is always false but maybe I overlooked something.
about interfaces: oh well that's quite... HUGE simplification. This machine is just workstation so it has only 1 network card, laptop has 2. By default OpenSUSE always makes bridge and bridges all interfaces under single address so physical NICs never have address bound to them. But on other machine working as DNS server / rsyslog server / router out of 31 interfaces (12 physical, 19 virtual) only 6 have address assigned and they're actually again bridges. All other ifaces are bridged or operating on L2 without address at all. Whereas I don't really think it's necessary to support full networking like vlans, tunnels etc (sounds pretty much like implementing support for full device mapper) i think that bridges and interface bonding should be supported because those 2 things are kinda common on workstations / desktop PCs and they introduce interfaces without address. I think VPNs and tunnels usually have own addresses as long as they operate as client tunnel not full network tunnel.
Thank you once again! I just published a patch (version 3.0.1)
.users
: I implemented a bug-fix for users
. Would be great if you can test it ;-).networkInterfaces
: I completely agree! I need to think of reimplementing it. I already have some ideas but this will take some time to get it reliable..services
: Ahhh, now I got it! Well thats a pretty nice idea, I think I will implement it in one of the next releases..disksIO
: I really found a small bug here, but this is not related to your comment. When walking through the code once again, I found an other small mistake ;-)So if your test concerning users
is ok, allow me to close this open issue. I will then think of rewriting networkInterfaces
in one of the next releases.
Thank you again!
I think it works. A bit weird but works. I mean on OpenSUSE it shows screen sessions and on Arch doesn't quite weird. But apart from that it works.
Oh wait no it totally doesn't work, doesn't show sessions running in other systemd slices ;) jk, I know It's detail I just learned today about systemd cool bits and it blown my mind.
However it might be good idea to filter out this:
{ user: 'lapsio',
tty: 'pts/0',
date: '2016-08-18',
time: '19:36',
ip: ':0',
command: '/bin/sh -c who; echo \'---\'; w | tail -n +2' }
because lol... Unfortunately it seems to be quite unpredictible. Now it shows full command but few seconds ago when I launched it it showed just w
without the rest of command. So it might not be worth to waste time on this
Thank you for testing again!! If ok, I will close it for now and make further investigations later. OK for you? I will anyway push another version 3.2 tomorrow morning
docker
supportbattery
support addedplus some smaller improvements
closing it for now. making further investigations later.
@sebhildebrandt are you still planning to implement show all nics?
@ricardopolo yes, as I have another open issue where this is relevant, I will refactor networkInterfaces()
So i just tried new version of systeminformation.
It doesn't crash without root - that's great. But few things don't look entirely correct:
whereas:
I just checked and
os.networkInterfaces
is also missing eno1And
.users()
returns empty array now on my machine.Here's result of command you use, I hope it helps: http://pastebin.com/YW41Dpma
I found it quite confusing that
.services
without srv argument return nothing instead of all and those "-1"s in many places also look confusing. I followed code and considering _disk_io.ms doesn't seem to be set anywhere they're like hardcoded?