Once you have installed and configured nagios-client in your Linux system you can easily monitor your LVM on Nagios tool. This LVM space monitoring only for low disk space.
Client configuration:
Download the files from the URL : http://www.lihas.de/anleitungen-und-service/check_vg_size
Move the file to that directory,
# mv check_vg_size /usr/local/nagios/libexec/.
# cd /usr/local/nagios/libexec/
# cd /usr/local/nagios/libexec/
To run the file give execute permission and nagios user permission,
# chmod +x check_vg_size
# chown nagios:nagios check_vg_size
# chown nagios:nagios check_vg_size
Now, you can check your volume group free space,
-w specified to Warning Status
-c specified to Critical Status
# ./check_vg_size -w 500 -c 300 -v vg0
VG vg0 OK Free Space 2230 GB gross
The above command pointing to warning and critical free disk space status.
If the script is functional, open your nagios nrpe.cfg file and add the below line into it.
# vim /usr/local/nagios/etc/nrpe.cfg
command[check_vg_size]=/usr/local/nagios/libexec/check_vg_size -w 500 -c 300 -v vg0
On Nagios Server :
Open client configuration file and define the service,
# vim /usr/local/nagios/etc/objects/host.hostname.cfg
define service{
use generic-service
host_name host.hostname.com
service_description LVM SPACE
check_command check_nrpe!check_vg_size
}
Save and execute below command to check the configuration whether is it right?
# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
output should be :
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
Finally, Restart the nagios server :
# /etc/init.d/nagios restart
Running configuration check...done.
Stopping nagios: done.
Starting nagios: done.
my vg name is Gitt-New. when i configured nagios with this script and check the command ./check_vg_size -w 500 -c 300 -v Gitt-New i am getting below error ./check_vg_size: line 83: [: =: unary operator expected VG Gitt-New CRITICAL verfuegbarer Platz ist 0 GB gross can you help me to sort this out???