# Generic way to check if pkg/freebsd-update would provides updates



## hashime (Jul 7, 2015)

Greetings

I am trying to write a Nagios/Icinga check for upgradeable packages.
Is there a way to check, after running `pkg update`, if there are updates available so i can return it to the monitoring system?
Also, same question for `freebsd-update`.


----------



## kpa (Jul 7, 2015)

For pkg you can use pkg-version(8). For example, this uses of the remote repository (-R option) as comparison:

`pkg version -RvL =`


----------



## hashime (Jul 7, 2015)

Thanks, that's exactly what i was looking for.


----------



## wblock@ (Jul 7, 2015)

Or maybe `pkg upgrade -n`?


----------



## hashime (Jul 7, 2015)

That worked out fine, icinga2 now notifies me when new packages are available on any of the monitored machines.
Now how would i got about this with freebsd-update. Are there any files `freebsd-update cron` creates or modifies, which i would be able to check? `freebsd-update cron` should download the patches automatically right? I simply could check if the directory it uses (no idea which) is populated right?


----------

