Hi Stan,
----- Original Message -----
> [...] - a python implementation of uptime(1). Attached; for your
> review/perusal/amusement ... somewhere in section 3.9 - "Programming
> Issues and Examples" would suit if you like it, after the C example
> perhaps. Sadly, it does not yet work - its exposing a bug in the py
> wrapper code for pmLocaltime(3) - also affects pmCtime(3) I think.
The current dev branch contains the fixes (turned out to be several
issues lurking here), and the attached uptime.py now works a treat.
$ ./uptime.py && /usr/bin/uptime
17:15:29 up 1:42, 8 users, load average: 0.06, 0.25, 0.17
17:15:29 up 1:42, 8 users, load average: 0.06, 0.25, 0.17
Looking at uptime.py I can't help but wish we'd got around to taking
on pmGetopt as discussed awhile back - with that, we'd have -h/-a/-S
"for free" (well, one more line of python code!). Then, we'd get to
answer questions like "what was the system uptime at 2pm yesterday -
just prior to the outage?", etc - looking forward to that!
cheers.
--
Nathan
uptime.py
Description: Text Data
|