thehunmonkgroup / nagios-plugin-newest-file-age

Nagios plugin, pulls the most recently created file in each specified directory, and checks its created time against the current time.
MIT License
11 stars 10 forks source link

add support for Alpine Linux #11

Closed pszafer closed 4 years ago

pszafer commented 4 years ago

As in the title. Let's check if disto is Alpine Linux, so then we know that we're using busybox stat.

thehunmonkgroup commented 4 years ago

Code looks good. Have you confirmed this works correctly on both Alpine and non-Alpine distros?

pszafer commented 4 years ago

Checked on Arch Linux (so GNU stat) and Alpine Linux, both works on fresh installs... but if somebody will install this package https://pkgs.alpinelinux.org/package/v3.11/main/x86/coreutils then it will have gnu stat as well.

So there are 3 options

thehunmonkgroup commented 4 years ago

Just so I'm clear: if people running Alpine Linux install the coreutils package, then the stat command will work on Alpine Linux without merging this PR?

pszafer commented 4 years ago

yes. coreutils package contains gnu stat.

thehunmonkgroup commented 4 years ago

OK, then I think I'd prefer to just mention that requirement for Alpine Linux in the README instead of adding custom logic to the script.

Would you like to adjust the PR to instead add that doc to the README, or should I instead close the PR and add it myself?

pszafer commented 4 years ago

I can change this PR tomorrow.

thehunmonkgroup commented 4 years ago

OK, great.

Maybe change the Tested to work on Linux/FreeBSD/OS X to a bullet list -- I think that'll make it easier to add individual caveats for each OS in the future.