监控存储(check-netapp-ng.pl):

 

下载网址:https://github.com/ranl/monitor-utils/blob/master/nagios/check-netapp-ng.pl

 

# mv check-netapp-ng.pl/usr/lib64/nagios/plugins/

# chmod +x /usr/lib64/nagios/plugins/check-netapp-ng.pl

 

使用:

aggr:

# /usr/lib64/nagios/plugins/check-netapp-ng.pl–H 10.0.0.3 –C public –T DISKUSED –v aggr0 –w 90 –c 95

 

卷:

# /usr/lib64/nagios/plugins/check-netapp-ng.pl–H 10.0.0.3 –C public –T DISKUSED –vol /vol/Backup –w 90 –c 95

 

整体状态:

# /usr/lib64/nagios/plugins/check-netapp-ng.pl–H 10.0.0.3 –C public –T GLOBALSTATUS

 

CPU:

# /usr/lib64/nagios/plugins/check-netapp-ng.pl–H 10.0.0.3 -C public -T CPULOAD –w 90 –c 95

IO:

# /usr/lib64/nagios/plugins/check-netapp-ng.pl–H 10.0.0.3 -C public -T FCPOPS

显示报警硬盘:

# /usr/lib64/nagios/plugins/check-netapp-ng.pl–H 10.0.0.3 –C public –T FAILEDDISK

显示所有硬盘情况:

# /usr/lib64/nagios/plugins/check-netapp-ng.pl–H 10.0.0.3 –C public –T DISKSUMMARY 

修改check-netapp-ng.pl让其显示aggr、vol的总大小、剩余大小等

# cp check-netapp-ng.pl check-netapp-ng2.pl

# vi check-netapp-ng2.pl  (默认为16、17,为已用大小,18、19为剩余大小,14、15为总大小)

my $snmp_netapp_volume_id_table_df_used_high = “$snmp_netapp_volume_id_table_df.18”;

my $snmp_netapp_volume_id_table_df_used_low = “$snmp_netapp_volume_id_table_df.19”;

:wq

icinga2监控存储整体状态(单个卷超过98%会报警的,卷及CPU调整vars.checktype值即可):

 

# vi/etc/icinga2/conf.d/templates.conf

 

objectCheckCommand “check-netapp” {

  import “plugin-check-command”

  command = [ PluginDir +”/check-netapp-ng.pl” ]

  arguments = {

  “-H” = “$address$”

  “-C” = “$snmp$”

  “-T” = “$checktype$”

  “-w” = “$warn$”

  “-c” = “$crit$”

}

}

:wq

 

# vi/etc/icinga2/conf.d/services.conf

 

applyService “check_netapp” {

  import “generic-service”

  check_command = “check-netapp”

  vars.snmp=”public”

  vars.checktype=”GLOBALSTATUS”

  vars.vol=”/vol/Backup/”

  assign where host.vars.os ==”netapp”

}

:wq

 

# vi/etc/icinga2/conf.d/netapp.conf

 

objectHost “shnas7” {

  import “generic-host”

  address = “10.0.1.21”

  vars.os = “netapp”

  vars.sla = “24×7”

  vars.notification[“mail”] = {

  groups = [ “icingaadmins” ]

}

}

:wq

 

# chownicinga:icinga /etc/icinga2/conf.d/netapp.conf

# service icinga2 restart