
Size: a a a
### MANAGED BY PUPPET#puppet #prometheus
#!/bin/sh
prom_file="/var/prometheus/textfile_exporter/available_upgrades.prom"
current_id="$$"
updates="0"
echo '# HELP available_upgrades Number of available upgrades' >> "${prom_file}${current_id}"
echo '# TYPE available_upgrades gauge' >> "${prom_file}${current_id}"
<% if @facts['os']['name'] == "Debian" or @facts['os']['name'] == "Ubuntu" -%>
updates=$(apt list --upgradeable | grep -v 'Listing' | wc -l)
<% elsif @facts['os']['name'] == "CentOS" or @facts['os']['name'] == "RedHat" -%>
fuck_centos=$(yum list updates)
if echo ${fuck_centos}|grep -q 'Available Upgrades'; then
updates=$($fuck_centos | awk '/Available Upgrades/{x=NR};{y=NR} END{printf y-x}')
fi
<% end -%>
echo "available_upgrades ${updates}" >> "${prom_file}${current_id}"
mv "${prom_file}${current_id}" "${prom_file}"
## 0.13.0 (August 10, 2020)More
> This is a list of changes relative to Terraform v0.12.29. To see the
>
> incremental changelogs for the v0.13.0 prereleases, see
>
> [the v0.13.0-rc1 changelog](https://github.com/hashicorp/terraform/blob/v0.13.0-...