Hi,
I'm not sure that's correct; surely setting
vars.apt_only_critical= true;

in the service should remove the need to do what you say, unless it's
broken?
James


On Fri, 12 Jul 2019 at 19:51, Václav Mach <ma...@cesnet.cz> wrote:

> Hi,
>
> On 7/1/19 12:01 AM, James Allsopp wrote:
> > Hi,
> > I'm getting lots of warnings about apt packages, but I only really care
> > about critical packages, not normal ones. I've changed the service in
> > apt.conf to;
> > apply Service "apt" {
> >    import "generic-service"
> >    check_command = "apt"
> >    vars.apt_only_critical = true
> >    assign where host.name == NodeName
> > }
> >
> > but I'm still getting problem e-mails, regardless of if I check now in
> the
> > web interface. I've tried to confirmed that the settings are valid and
> > restarted the service, but no improvement. No ideas how I can get this to
> > only send out warnings when the packages are critical?
>
> you should create a spefic notification if you want to get notification
> only for critical state. It may look somehow like this:
>
> template Notification "critical_only notification" {
>      command = "mail-service-notification"
>      interval = 1d
>      states = [ Critical, OK, Unknown,]
>      types = [ Acknowledgement, Custom, Problem, Recovery ]
> }
>
> you can then import in your service:
>
> apply Service "apt" {
>     import "generic-service"
>     import "critical_only notification"
>     check_command = "apt"
>     vars.apt_only_critical = true
>     assign where host.name == NodeName
> }
>
> cheers,
> Vaclav
>
> --
> Václav Mach
> tel: +420 234 680 206
> CESNET, z.s.p.o.
> www.cesnet.cz
>
> _______________________________________________
> icinga-users mailing list
> icinga-users@lists.icinga.org
> https://lists.icinga.org/mailman/listinfo/icinga-users
>
_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to