I’ve rolled out disk checks via director to monitor nscp-local-disk, we’re getting alerted of false positives due to optical drives, both empty and populated, is there an easy way of excluding these?
The example I have is as follows where G, E and I are optical drives…
Since you’re using the Director, in fact: yes. You might leverage this into host templates where you define a generic custom variable for this, and only override this with specific other host templates you’ll then import into the host objects.
That’s exactly what I’m after thanks @anon66228339, so it’s a question of where I can fit that filter into director to roll it out in my generic host template?
Yes makes much more sense that way, is the filter on the service template that could be added in via the director web interface, can’t figure out where to apply it.
edit - Would you not change the definition of the command instead @anon66228339?
No, because then you would have copy the Icinga 2 provided command and create and maintain your own. Better hide this inside the template logic thus overriding any other settings. Bonus: You’ll see that custom variable in the detail views and know about it.
So, I’m feeling mega stupid at the moment, this is one of the last few tweaks I’ve got to make until I can just roll agents out across my whole estate.
I can not figure out for the life of me how to incorporate filter=type not in ('CDROM', 'REMOVABLE') into the service template within director.
I presume, based on previous advice I shouldn’t be editing any of the conf files for director, but I can’t find where I would input the filter within director.
Starting to wish I’d not started with Icinga now but I’m that far along it feels like a waste to throw it away!
Now select nscp_disk_arguments and add this field. This exports the field for usage in your service and host templates (and objects).
Once that’s done, you’ll go back into your service template (newly created or existing, doesn’t matter).
Pick the nscp-local-disk as check_command, if not done yet. The Custom Properties line has now an additional field entry, the one you’ve defined before.
Select and add the value filter=type not in ('CDROM', 'REMOVABLE') to it. Save it and deploy your services which import this template.