I have a script that runs weekly to do routine maintenance: zpool scrubs, check disk smart attributes and run disk self-tests, ... I used to use nagios but it tended to supply a lot of info, most reporting "no action needed". My own version logs all responses only notifies me when action is needed (in some cases, using reworked nagios plugins). Optimally, I want to separate 3 scenarios: no updates, some updates and something went wrong.
I'm using RELEASE binary freebsd versions, no ports and few packages. I want to add code to tell me updates are needed. I found many posts on this forum recommending how to do updates and decided to look at the exit codes (hopefully) or text output of
Any suggestions on where exit codes are documented? If not, I'm stuck grepping the response text and hoping it doesn't change :-(
I'm using RELEASE binary freebsd versions, no ports and few packages. I want to add code to tell me updates are needed. I found many posts on this forum recommending how to do updates and decided to look at the exit codes (hopefully) or text output of
freebsd-update updatesready
and pkg upgrade --dryrun
. But I can't find documentation on the exit codes. The man page for freebsd-update updatesready says "Returns exit code 2 if there are no updates to install", and nothing else. man pkg and man pkg-upgrade say nothing about exit codes. My system doesn't need updates now and both commands return zero.Any suggestions on where exit codes are documented? If not, I'm stuck grepping the response text and hoping it doesn't change :-(