We have about 10 servers which an NFS partition is mounted on all of them. All hosts on Icinga displays that NFS partition, so when NFS partition threshold is reached 10 mail notifications are sent for that specific error.
The question is how can I remove NFS partition from different hosts.
For now default config is as below:
apply Service for (display_name => config in host.vars.snmp.disks) {
import "generic-service-faxir"
check_command = "snmp-storage-parameteric"
vars += config
if (vars.snmp_warn == ""){
vars.snmp_warn = "70"
}
if (vars.snmp_crit == ""){
vars.snmp_crit = "85"
}
//Converting capacity to percentage
if(vars.capacity != ""){
if(vars.capacity_warn != ""){
vars.snmp_warn = 100 * vars.capacity_warn / vars.capacity
}
if(vars.capacity_crit != ""){
vars.snmp_crit = 100 * vars.capacity_crit / vars.capacity
}
}
//ext2, ext3, and ext4 has 5% reserved for OS
if (host.vars.os == "Linux"){
vars.snmp_storage_reserved = 5
}
ignore where host.vars.os !in ["Linux", "Windows"]
}
EDIT1: the command code is as below:
/**
* based on:
* snmp storage - Disk/Memory
* Url reference: http://nagios.manubulon.com/snmp_storage.html
*/
object CheckCommand "snmp-storage-parameteric" {
import "snmp-manubulon-command"
command = [ ManubulonPluginDir + "/check_snmp_storage.pl" ]
arguments += {
"-m" = "$snmp_storage_name$"
"-f" = {
set_if = "$snmp_perf$"
}
"-R" = "$snmp_storage_reserved$"
"-T" = "$snmp_storage_type$"
"-G" = ""
}
vars.snmp_storage_name = "^/$$"
vars.snmp_storage_type = "pu"
vars.snmp_warn = 80
vars.snmp_crit = 90
vars.snmp_perf = true
vars.snmp_storage_reserved=0
}
I haven't tried it, but you could look into the following command parameters:
match a name pattern - https://github.com/dnsmichi/manubulon-snmp/blob/master/plugins/check_snmp_storage.pl#L164
-m, --name=NAME
Name in description OID (can be mounpoints '/home' or 'Swap Space'...)
This is treated as a regexp : -m /var will match /var , /var/log, /opt/var ...
Test it before, because there are known bugs (ex : trailling /)
No trailing slash for mountpoints !
exclude specific volumes - https://github.com/dnsmichi/manubulon-snmp/blob/master/plugins/check_snmp_storage.pl#L180
-e, --exclude
Select all storages except the one(s) selected by -m
No action on storage type selection
select a storage type - https://github.com/dnsmichi/manubulon-snmp/blob/master/plugins/check_snmp_storage.pl#L169
"-q, --storagetype=[Other|Ram|VirtualMemory|FixedDisk|RemovableDisk|FloppyDisk
CompactDisk|RamDisk|FlashMemory|NetworkDisk]
Best is to test the various parameters on the command line and then add them to your CheckCommand and Service definition.