Monitoring Netapp filers using nagios monitoring tool



Monitoring Netapp Filers using Nagios Monitoring tool
STEP 1: To Monitor the Netapp Filers first we need to download the Plugins.
Use below Link:
Then copy into your Nagios Server then verify if it is working or not Manually.
STEP 2:  [root@NagiosServer libexec]# ./check-netapp-ng.pl -H 192.168.1.2 -C public -T NVRAM
OK: NVRAM ok | nvrambatterystatus=1
[root@NagiosServer libexec]# ./check-netapp-ng.pl -H  192.168.1.2 -C public -T CPULOAD
OK: CPULOAD 56% | cpuload=56percent
If it is working fine then copy the Plugin to your Nagios libexec Directory.
STEP 3: cp check-netapp-ng.pl check_netapp3.pl /usr/local/nagios/libexec
STEP 4: Edit your Template File.
Vi /usr/local/nagios/etc/objects/templates.cfg
In Last line insert the below template.

############################### Template Start #####################################
define service{
        name                            generic-service-storage         ; The 'name' of this service template
        active_checks_enabled           1                       ; Active service checks are enabled
        passive_checks_enabled          1                       ; Passive service checks are enabled/accepted
        parallelize_check               1                       ; Active service checks should be parallelized (disabling this can lead to major performance problems)
        obsess_over_service             1                       ; We should obsess over this service (if necessary)
        check_freshness                 0                       ; Default is to NOT check service 'freshness'
        notifications_enabled           1                       ; Service notifications are enabled
        event_handler_enabled           1                     
        flap_detection_enabled          1                       ; Flap detection is enabled
        process_perf_data               1                       ; Process performance data
        retain_status_information       1                       ; Retain status information across program restarts
        retain_nonstatus_information    1                       ; Retain non-status information across program restarts
        is_volatile                     0                       ; The service is not volatile
        check_period                    24x7                    ; The service can be checked at any time of the day
        max_check_attempts              3                       ; Re-check the service up to 3 times in order to determine its final (hard) state
        normal_check_interval           5                      ; Check the service every 10 minutes under normal conditions
        retry_check_interval            2                       ; Re-check the service every two minutes until a hard state can be determined
        contact_groups                  admins     ; Notifications get sent out to everyone in the 'admins' group
        notification_options            c,r                 ; Send notifications about warning, unknown, critical, and recovery events
        #notification_interval           60                     ; Re-notify about service problems every hour
        notification_interval           0               ; Do not Resend
        notification_period             24x7                    ; Notifications can be sent out at any time
         register                        0                      ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
        }
############################ Template End #########################################

Save and Exit

STEP 5: Edit Commands.cfg file to define the Commands.

vi /usr/local/nagios/etc/objects/commands.cfg

# Netapp System checks
define command{
        command_name    check_netapp_sys2
        command_line    $USER1$/check-netapp-ng.pl -H $HOSTADDRESS$ -C public -T $ARG1$ -w $ARG2$ -c $ARG3$
}

# Netapp System checks
define command{
        command_name    check_netapp_uptime
        command_line    $USER1$/check-netapp-ng.pl -H $HOSTADDRESS$ -C public -T UPTIME
}

# Netapp System checks
define command{
        command_name    check_netapp_nvram2
        command_line    $USER1$/check-netapp-ng.pl -H $HOSTADDRESS$ -C public -T NVRAM
}


# 'check_local_mrtgtraf' command definition
define command{
        command_name    check_local_mrtgtraf
        command_line    $USER1$/check_mrtgtraf -F $ARG1$ -a $ARG2$ -w $ARG3$ -c $ARG4$ -e $ARG5$
        }

define command{
        command_name check_cpback
        command_line $USER1$/check_netapp3.pl -H $HOSTADDRESS$ -C public -v CPBACK
        }

define command{
        command_name check_cptime
        command_line $USER1$/check_netapp3.pl -H $HOSTADDRESS$ -C public -v CPTIME
        }

define command{
        command_name check_globalstatus
        command_line $USER1$/check_netapp3.pl -H $HOSTADDRESS$ -C public -v GLOBALSTATUS
        }

Save & exit


STEP 6: To Add Multiple Filers to monitor create one directory and add that directory path to nagios.cfg file.

Vi /usr/local/nagios/etc/nagios.cfg

cfg_dir=/usr/local/nagios/etc/objects/monitor/

In my case I have created a directory called monitor

Create one file in your monitoring directory path with the Filer Name.

Example: Netapp-Filer-01

STEP 7: touch /usr/local/nagios/etc/objects/monitor/Netapp-Filer-01.cfg

STEP 8: Vi /usr/local/nagios/etc/objects/monitor/Netapp-Filer-01.cfg

Insert the below content.

######################################
# HOST DEFINATION: NETAPP-FILER      #
######################################


################################ Host Alive Check ###################################
define host{
        use                     linux-server
        host_name               NETAPP-FILER
        alias                   Filer Name:NETAPP-FILER S.No:99586215553 Location:India-Hyderabad Model:FAS3140
        address                 192.168.1.2
        action_url            /pnp4nagios/graph?host=$HOSTNAME$
        }


################################ PING Status ######################################
define service{
        use                             generic-service
        host_name                       NETAPP-FILER
        service_description             PING
        check_command                   check_ping!200.0,40%!500.0,60%
        notifications_enabled           1
        process_perf_data               1
        action_url            /pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$
        }

################################ service SSH Status ##################################
define service{
        use                             local-service
        host_name                       NETAPP-FILER
        service_description             SSH
        check_command                   check_ssh
        notifications_enabled           1
        process_perf_data               1
        action_url            /pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$
        }

################################ FAN Status #####################################
define service{
        use                             generic-service-storage
        host_name                       NETAPP-FILER
        service_description             FAN Status
        check_command                   check_netapp_sys2!FAN
        action_url            /pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$
        process_perf_data               1
        }

############################# Power Supply Status ###################################
define service{
        use                             generic-service-storage
        host_name                       NETAPP-FILER
        service_description             Power Supply Status
        check_command                   check_netapp_sys2!PS
        action_url            /pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$
        process_perf_data               1
        }


################################ Temprature Status ##################################
define service{
        use                             generic-service-storage
        host_name                       NETAPP-FILER
        service_description             Tempreture Status
        check_command                   check_netapp_sys2!TEMP
        action_url            /pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$
        process_perf_data               1
        }

############################ CPULOAD Monitoring ##################################
define service{
        use                             generic-service-storage
        host_name                       NETAPP-FILER
        service_description             CPU Load
        check_command                   check_netapp_sys2!CPULOAD!80!90
        action_url            /pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$
        process_perf_data               1
        }

################################ If Any failed Disks ##################################
define service{
        use                             generic-service-storage
        host_name                       NETAPP-FILER
        service_description             Failed Disk
        check_command                   check_netapp_sys2!FAILEDDISK
        action_url            /pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$
        }


######################## Filer Uptime Used check any Reboot happened recently ##############
define service{
        use                             generic-service-storage
        host_name                       NETAPP-FILER
        service_description             UPTIME
        check_command                   check_netapp_uptime
        action_url            /pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$
        process_perf_data               1
        }

################################ NVRAM Status ###################################
define service{
        use                             generic-service-storage
        host_name                       NETAPP-FILER
        service_description             NVRAM
        check_command                   check_netapp_nvram2
        action_url            /pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$
        process_perf_data               1
        }
####################### Management Port Bandwidth ##################################
define service{
        use                     generic-service-storage
        host_name               NETAPP-FILER
        service_description     e0M Bandwidth
         check_command           check_local_mrtgtraf!/var/www/mrtg/192.168.1.2_7.log!AVG!800000000,800000000!1000000000,1000000000!10
        process_perf_data        1
        }


############################# Consistency Status #####################################
define service{
        use                     generic-service-storage
        host_name               NETAPP-FILER
        service_description     Back to Back Consistency Time
        check_command           check_cpback
        process_perf_data       1
        }
################################ Consistency Time ##################################
define service{
        use                     generic-service-storage
        host_name               NETAPP-FILER
        service_description     Consistency Full Time
        check_command           check_cptime
        process_perf_data       1
        }
################################ Global Status #####################################
define service{
        use                     generic-service-storage
        host_name               NETAPP-FILER
        service_description     Global Status
        check_command           check_globalstatus
        process_perf_data       1
        }

Save & Exit

Then restart the Nagios Service.

STEP 8: Service nagios restart

STEP 9: Adding the Netapp Filer Bandwidth Monitoring You have to do below steps.

Run below Commands in NagiosServer
cfgmaker --global 'WorkDir:/var/www/mrtg' --output /etc/mrtg/192.168.1.2.cfg public@192.168.1.2

env LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/192.168.1.2.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok

then Create a cron job for every 5 minutes

STEP 10: crontab –e
*/5 * * * * env LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/192.168.1.2.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok


No comments:

Post a Comment