Internal libraries
The internal libraries had been refactored.
Now, almost all of them, have been moved under NMISNG:
- use NMIS; → Replaced by use NMISNG;
- use func; → Replaced by use NMISNG::Util;
Please, check the internal structure for other libraries.
Database Access
As the new data backend has been moved from NMIS files to the mongo database, the node information access is different.
Sys::ndinfo has been replaced by Sys::nmisng_node and Node::nmisng_node can be accessed directly rather than accessing Sys::nmisng_node
- Sys::ndinfo->{system} becomes hash returned by Node::configuration()
- Node::Configuration()->{roleType} replaces NMIS::loadLocalNodeTable()>{<a_node_name>} {role}
- Be warned that Sys::ndinfo->{system} key values often carry the strings "true" and "false" for boolean whereas Node::configuration() returns hash key values will carry 0 and 1 for boolean.
- Therefore one should always use Common::getBool() to evaluate key values.
- Furthermore, Node::configuration() returns a clone copy each call, therefore it is advisable to set a variable if re-used:
- Sys::ndinfo->{status} becomes Node::get_status_model_data()
- NMIS8 ref(Sys::ndinfo->{status}) versus NMIS9 ref(Node::get_status_model_data)
- NMIS8 Sys::ndinfo->{status} was a hash of hashes, whereas
- NMIS9 Node::get_status_model_data() is an array of hashes.
- NMIS8 Sys::ndinfo->{status}->{source} is not a hashkey in Node::get_status_model_data()
- NMIS8 Sys::ndinfo->{status} has entries either by 'source' or by 'index', whereas
- NMIS9 Node::get_status_model_data() only has entries by 'index'
- NMIS8 <object>->{<a_node>}->{active} should be replaced by
- Node::configuration→{active}
- NMIS8 ref(Sys::ndinfo->{status}) versus NMIS9 ref(Node::get_status_model_data)
- Sys::ndinfo->{sysUpTime} is replaced by Node::node_summary->{sysUpTimeSec}
Related Documentation
- You can see a complete example of a collect plugin in the Host_Resources plugin (Released in 9.1.2).
- NMIS 9 collect and update plugins