Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Nakivo Backup and Replication monitoring
1.8.8
2016-04-12
- Nagios 3.x
GPL
41939
File | Description |
---|---|
check_nakivo_job.pl | Check the status of a Nakivo Backup Job |
check_nakivo_repository.pl | Check state and free space of Nakivo Repository |
Place the scripts in the /usr/lib/nagios/plugins folder and make them executable. Each of the scripts need to be edited and the Nakivo username and password filled in.
These perl scripts are using the Nakivo commandline interface script (/opt/nakivo/director/bi/cli.sh). Make sure that this script is also made executable, otherwise you get Access Denied. With this Nakivo script you can determine all backup jobs defined in it with the following command:
./cli.sh -jl -u -pwd .
The username and password are the same you use to login to Nakivo.
Also get a list of repositories in a similar way:
./cli.sh -rl -u -pwd .
Each of the jobs and repositories are numbered and you need that number to enter the check command in the nrpe.cfg file. Examples:
command[check_nakivo_job2]=/usr/lib/nagios/plugins/check_nakivo_job.pl -j 2
command[check_nakivo_repository2]=/usr/lib/nagios/plugins/check_nakivo_repository.pl -r 2 -w 5000 -c 500
The first will check job ID = 2 and report if the job ended ok or not. It will give a warning when the last run was not ok AND the job is currently running.
The second command is to check repository ID = 2 and report the state and check the free space. The free space levels is set by the -w (warning) and -c (critical) levels in MB. So in the example the warning will be activated when free space sinks below 5GB and goes red when it almost reach the bottom at 500MB.
Currently working with Nakivo v3.1 to v3.9.
Update 1.7.1: Handle large numbers with , in the Repository script.
Update 1.7.3: Change in output of Nakivo v3.9, made script more adaptive.
Update 1.8.8: Added the Status output with maintenance info. If maintenance is running the level will turn yellow (Warning).
Feel free to change the files and use it as you see fit. Good luck!
These perl scripts are using the Nakivo commandline interface script (/opt/nakivo/director/bi/cli.sh). Make sure that this script is also made executable, otherwise you get Access Denied. With this Nakivo script you can determine all backup jobs defined in it with the following command:
./cli.sh -jl -u
The username and password are the same you use to login to Nakivo.
Also get a list of repositories in a similar way:
./cli.sh -rl -u
Each of the jobs and repositories are numbered and you need that number to enter the check command in the nrpe.cfg file. Examples:
command[check_nakivo_job2]=/usr/lib/nagios/plugins/check_nakivo_job.pl -j 2
command[check_nakivo_repository2]=/usr/lib/nagios/plugins/check_nakivo_repository.pl -r 2 -w 5000 -c 500
The first will check job ID = 2 and report if the job ended ok or not. It will give a warning when the last run was not ok AND the job is currently running.
The second command is to check repository ID = 2 and report the state and check the free space. The free space levels is set by the -w (warning) and -c (critical) levels in MB. So in the example the warning will be activated when free space sinks below 5GB and goes red when it almost reach the bottom at 500MB.
Currently working with Nakivo v3.1 to v3.9.
Update 1.7.1: Handle large numbers with , in the Repository script.
Update 1.7.3: Change in output of Nakivo v3.9, made script more adaptive.
Update 1.8.8: Added the Status output with maintenance info. If maintenance is running the level will turn yellow (Warning).
Feel free to change the files and use it as you see fit. Good luck!
Reviews (1)
bympleite, November 26, 2021
root@nakivo:/opt/nakivo/director/bin# /usr/lib/nagios/plugins/check_nakivo_job.pl -j 1
sh: 1: Syntax error: redirection unexpected
Use of uninitialized value $part[4] in substitution (s///) at /usr/lib/nagios/plugins/check_nakivo_job.pl line 68.
Use of uninitialized value $part[5] in substitution (s///) at /usr/lib/nagios/plugins/check_nakivo_job.pl line 69.
Use of uninitialized value $part[6] in substitution (s///) at /usr/lib/nagios/plugins/check_nakivo_job.pl line 70.
Use of uninitialized value $part[6] in pattern match (m//) at /usr/lib/nagios/plugins/check_nakivo_job.pl line 72.
Use of uninitialized value $part[5] in pattern match (m//) at /usr/lib/nagios/plugins/check_nakivo_job.pl line 76.
Use of uninitialized value $part[4] in concatenation (.) or string at /usr/lib/nagios/plugins/check_nakivo_job.pl line 86.
Use of uninitialized value $part[6] in concatenation (.) or string at /usr/lib/nagios/plugins/check_nakivo_job.pl line 86.
Nakivo Job is CRITICAL - :
sh: 1: Syntax error: redirection unexpected
Use of uninitialized value $part[4] in substitution (s///) at /usr/lib/nagios/plugins/check_nakivo_job.pl line 68.
Use of uninitialized value $part[5] in substitution (s///) at /usr/lib/nagios/plugins/check_nakivo_job.pl line 69.
Use of uninitialized value $part[6] in substitution (s///) at /usr/lib/nagios/plugins/check_nakivo_job.pl line 70.
Use of uninitialized value $part[6] in pattern match (m//) at /usr/lib/nagios/plugins/check_nakivo_job.pl line 72.
Use of uninitialized value $part[5] in pattern match (m//) at /usr/lib/nagios/plugins/check_nakivo_job.pl line 76.
Use of uninitialized value $part[4] in concatenation (.) or string at /usr/lib/nagios/plugins/check_nakivo_job.pl line 86.
Use of uninitialized value $part[6] in concatenation (.) or string at /usr/lib/nagios/plugins/check_nakivo_job.pl line 86.
Nakivo Job is CRITICAL - :