Add hostname to modem down log file name

Suggest new features here
Post Reply
KN2TOD
Posts: 268
Joined: Sun Nov 11, 2018 6:36 pm

Add hostname to modem down log file name

Post by KN2TOD »

Consider adding the hostname to the file name created by the /admin/download_modem_log.php process. Currently the filename is simply patterned "Pi-Star_MMDVM-yyyy-mm-dd" but the hostname (e.g Pi-Star-1, Pi-Star-2, etc) should be included to further delineate the source of the file.
User avatar
MW0MWZ
Site Admin
Posts: 1505
Joined: Wed Apr 04, 2018 9:15 pm
Location: Wales, UK
Contact:

Re: Add hostname to modem down log file name

Post by MW0MWZ »

Good idea - done deal.
Andy

73 de MW0MWZ
http://pistar.uk
KN2TOD
Posts: 268
Joined: Sun Nov 11, 2018 6:36 pm

Re: Add hostname to modem down log file name

Post by KN2TOD »

Great!

FWIW, this is the change I worked up for this modification:

sed -i 's% $unixfile);%$unixfile);\n\texec("cat /etc/hostname",$output);\n\t$hostname = strtoupper($output[0])."_".basename($logfile);%'

sed -i 's%Pi-Star_\x27.basename($logfile)%\x27.$hostname%'

Image
Attachments
Modem File Download.jpg
Modem File Download.jpg (60.59 KiB) Viewed 2648 times
KN2TOD
Posts: 268
Joined: Sun Nov 11, 2018 6:36 pm

Re: Add hostname to modem down log file name

Post by KN2TOD »

Nevermind. Your solution is clearner/clearer!

I notice whenever a change is rolled out that overwrites something I've modified that the callsign reverts back to M1ABC and the language gets changed to English_UK. The callsign doesn't actually get changed in the config file so simply reapplying that section restores everything back to normal. It seems like the update log isn't reflecting exactly what is going on here in these situations.
KN2TOD
Posts: 268
Joined: Sun Nov 11, 2018 6:36 pm

Re: Add hostname to modem down log file name

Post by KN2TOD »

Seems like the "hostname" should replace the "Pi-Star_" prefix to the filename. My downloads come out looking a little redundant (wordy?): "Pi-Star_pi-star-1_MMDVM...." rather than "pi-star-1_MMDVM..".
User avatar
MW0MWZ
Site Admin
Posts: 1505
Joined: Wed Apr 04, 2018 9:15 pm
Location: Wales, UK
Contact:

Re: Add hostname to modem down log file name

Post by MW0MWZ »

KN2TOD wrote: Sat May 16, 2020 8:39 pm Seems like the "hostname" should replace the "Pi-Star_" prefix to the filename. My downloads come out looking a little redundant (wordy?): "Pi-Star_pi-star-1_MMDVM...." rather than "pi-star-1_MMDVM..".
They follow the same standard as the config downloads - so they should all come out "Pi-Star_" then whatever it is, including the name of the log etc.

So - yes its a little wordy, but I'd prefer to think of it as descriptive :)
Andy

73 de MW0MWZ
http://pistar.uk
Post Reply