Open aquette opened 10 years ago
Actually, the nutdrv-repeater driver might also be useful for modifying values from an UPS that is reporting predictably incorrect values. I think this was the original motivation behind the thread that inspired #97 (min/max reporting).
Obviously, if we can unambiguously detect that a driver should scale or offset a value, then we should do that in the driver, but if it is a calibration issue, or if the UPS hardware cannot be uniquely identified, then I think this should be handled by a repeater. That way, upsmon can still connect directly to the real driver, but graphing software can talk to the repeater.
The repeater might be best implemented in a high-level language like Python, where the scale/offset operations can be done with an 'eval' statement.
what about something like this? https://github.com/zykh/nut-ddl-raw/blob/master/Manufacturer1/ModelFamily1/Manufacturer1__ModelFamily1__ActualModel1__driver-name__NUTVersion2.dev
RW:var.name:<type>:<option>\n
CMD:command.name\n
If we want new dumps to be backward compatible we could:
RW:<var.name>:<type>:<option>\n
, CMD:<cmd.name>\n
)However doing this would mean we won't be able to use parseconf (at least as it is now, since #
lines are treated as comments and ignored)
https://github.com/zykh/nut-ddl-raw/blob/master/Manufacturer1/ModelFamily1/Manufacturer1__ModelFamily1__ActualModel1__driver-name__NUTVersion2.backward_compatible.dev
We may want to split things down to Manufacturer/Model_Families/Models: https://github.com/zykh/nut-ddl-raw
Since we want to record (both in dev and sec files) also rw vars and commands instead of relying on the output from upsc/upsrw/upscmd and then parse it we may want use directly NUT's net-protocol.
We could use PyNUT or maybe upsclient, just like ups{c,cmd,rw}.. and since we are there.. what about merging ups{c,cmd,rw}/nut-recorder in something like a 'nut-controller'?
.dev/.seq files - ..follow-up:
If we don't care about it being backward compatible we could get rid of colons altogether:
var.name var value
RW var.name <type> <options>
CMD command.name
This would be easier to handle with parseconf.
@zykh: this doesn't sound bad at all, and we're definitely on the same page!
Many considerations:
The need to have a dummy driver is clearly to have a simulation driver. This needs to address three points, in order of importance:
We need to record data ... to replay them.
But we probably need to record different level of data.
I think we will have a complete correct vision of what is done in nut data flow when we will ready to have these 3 levels. So recording is not the job of a dedicated agent in the nut system. Such job must be addressed by different actors in nut system. (to be completed).
I think this needs some big rework and cannot be achieve soon. But it make sense to be considered.
A strange thing is remaining in nut distribution is the presence of many executables to do similar requests: upsc/upsrw/upscmd. Why not ! But why ? Perhaps having a nutclient command that will process all commands can be a good idea. It can process commands from:
A such client can process commands like network commands:
GET UPS
GET VAR UPS1...
SET VAR ...
This can be nammed "nutclient". It is more in line with actual commands and library (like libnutclient). Moreover the "nut controller" will be used to the internal orchestrator for future nut system.
@clepple : on the repeater part and your above answer... a cleaner / simpler approach would be allowed through some scaling mechanism / directive and common code in main (as for the "override" for example).
@aquette,
a cleaner / simpler approach would be allowed through some scaling mechanism / directive and common code in main (as for the "override" for example).
I guess, although the common code should not have more than a multiplier and an offset.
If people need more powerful scripting capabilities to adjust reported values, it should not be in the driver core.
dummycons (1rst generation) and dummy-ups (2nd generation) have well served various purposes, such as:
The work on dummy-ups also permitted the creation of the NUT Devices Dumps Library (http://www.networkupstools.org/devdumps/).
However, time has come for a 3rd generation to address the following, either in definition files (.dev / . seq) and / or the driver: