jeffbass/imagenode

nodehealth.py - get_ipaddress in 0.3.0

Opened this issue · 1 comments

Hey Jeff,
I've loaded 0.3.0, and I have a question about valid_prefix in the function get_ipaddress of nodehealth.py. According the commented portion of line 115 we are supposed to edit that line to our IP address...Is that correct?

Do I need to do anything else for version 0.3.0?

Stephen B Kirby

Hi Stephen,

Yes, setting valid_prefix in the function get_ipaddress of nodehealth.py should be the only change you need to make to get the new 0.3.0 version of imagenode working versus the old one. Sorry, I should have documented that. I listed the new restart event message in HISTORY.md for 0.3.0. The ip_address_prefix will become an optional YAML item in the node: section. It is part of preparing the imagenode and imagehub code for pushing the my first librarian version to GitHub. To help the librarian monitor the status of all the imagenodes, I've added a 'Restart' event message to imagnode. It sends a multi-field message each time the imagenode starts or restarts. The message looks like this:

2021-01-09 07:59:11,802 ~ Barn|Restart|rpi12|RPi|192.168.86.121|860|290.87

where the fields after the word Restart are imagenode characteristics helpful to the librarian:

   ...   |Restart| <<localhost name>> | <<system type>>  | <<ip address>> | <<RAM size>> | << time since last restart >>

The plan is to add a YAML option named ip_address_prefix and document it. If it is not provided, something (TBD) will be substituted for the ip address in the restart message. The code in the function get_ipaddress returns an externally usable ip address in numeric format.

This new restart message appears in the imagehub event messages logs. I also changed the imagehub log rotation schedule. The change is described in imagehub issue # 4. Again, I apologize for not documenting this 'half built' code change. I am interating changes simultaneously in imagenode, imagehub and librarian so I can get the first push of librarian done.

If you catch any other issues with 0.3.0, please post them. I'll leave this issue open until I've got the ip_address_prefix YAML option built and documented. If you want to set up a first draft of the new ip_address_prefix in settings and document them in a pull request, that would be helpful. I won't get to that for a while. And I still need to decide what I want to do when an ip address prefix is not provided. I definitely want it to be optional, but need to put something in the restart message. Maybe just 'None' for now.
Thanks,
Jeff