Monitoring Netvault with PowerShell

Number of servers explode in on premise or cloud infrastrctures, and if you really want to be pro-active you need to monitor your stuff. Backups is on of theses stuffes. I mean Datas are the key of your business, so be able to recover them with calm is truely awesome.

In my company, we recently deploy Dell Netvault solution which is very good, but we never success in sending SNMP traps to our Nagios pooler. The MIB was recognized, but nothing is parsed in the monitoring systems. So we decided to use Netvault, PowerShell and NSClient++ to correctly monitor the solution. In this post, i’ll try to explain how we works and why we choose this solution and not another.

Configure Netvault reports

Netvault is kind of a powerfull software, and as it’s at first a linux product, you have all configuration stored in flat files, so everything is really easy to hack and modify as your wish.

To work with my script bellow, you will have to created a file named nagios in your Netvault templates directory.

Thanks to this, we will be able to create a csv with needed informations. By the way, the column size is not dynamic, so if some columns missing chars, don’t hesistate to increase interger values in the line starting by %FORMAT.

 

Extract and display informations

Here is how i exctract and play with datas exported by Netvault tools.

You must register this script in C:\Program Files\NSClient++\scripts

Configure NSClient

If you use Nagios and you don’t use NSClient for your Windows hosts, you miss something. This tool will able you to use NRPE commands on your system to improve your monitoring. The part intresting, is you can also execute PowerShell scripts !

To enable scripts execution you must uncomment a line in the NSC.ini file located by default here: C:\Program Files\NSClient++

Find:

; Script to check external scripts and/or internal aliases.

Remove the ; of the next line:

CheckExternalScripts.dll

 

And in the [External Scripts] part, add your script execution, like this:

check_netvault=cmd /c echo scripts\Resporting_Netvault.ps1; exit($lastexitcode) | powershell.exe -command –

 

Now you just have to add this check in your Nagios server, and you have monitoring on your backups of the last night !

Hope you will find this helpfull.