Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Windows Server Backup 2008/7 Powershell Passive Check
1.5
2012-03-03
- Nagios 3.x
- Nagios XI
- Nagios Fusion
90325
File | Description |
---|---|
Nagios Windows Backup Script V1.5.rar | Latest Version |
Nagios Windows Backup Script.rar | Original Version |
Meet The New Nagios Core Services Platform
Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.
Monitoring Made Magically Better
- Nagios Core on Overdrive
- Powerful Monitoring Dashboards
- Time-Saving Configuration Wizards
- Open Source Powered Monitoring On Steroids
- And So Much More!
Script was written because I wanted to monitor a lot of offsite servers using Windows Server Backup. The script eliminates daily email notifications and will allow you to be alerted when the status is unknown.
Version 1.5 - Updated to show the amount of backups available in the service status information
The PowerShell Script executes by the task scheduler and dumps the Windows Server Backup log file to a text file. The script looks for the last backup date that should be present in the log if the backup is successful. If the date is not present then the backup has failed. The script sends a passive check to Nagios via NSCAweb using cURL HTTP requests indicating that the backup is successful or not.
*Script Requires NSCAweb: http://wiki.smetj.net/wiki/Nscaweb
the PowerShell script uses cURL (contained in zip file) to send HTTP requests to NSCAweb's local queue which reports to Nagios.
*The default port 5668 should be allowed inbound to the Nagios server if you are checking hosts over the internet
*No ports need to be forwarded on the monitored host's network(Uses HTTP Request to get the info to Nagios)
*The services in Nagios should be set to passive checks only
*Freshness checking should be setup so you are alerted when the passive check does not report in
http://nagios.sourceforge.net/docs/3_0/freshness.html
*the ZIP file contains a task that can be imported and is set to launch the PowerShell script daily at 7:00AM as the system account. The task launches the script from "C:Nagios Windows Backup Script"
*The PowerShell execution policy may need to be changed for the script to run (Set-ExecutionPolicy bypass)
*Launch the PowerShell script manually to troubleshoot
3/22/2012 - Reuploaded script with "wbadmin get versions" uncommented. Had it commented for testing. Sorry.
Please let me know how this is working for you and if you have any suggestions.
Thanks,
Zachary Niezelski
The PowerShell Script executes by the task scheduler and dumps the Windows Server Backup log file to a text file. The script looks for the last backup date that should be present in the log if the backup is successful. If the date is not present then the backup has failed. The script sends a passive check to Nagios via NSCAweb using cURL HTTP requests indicating that the backup is successful or not.
*Script Requires NSCAweb: http://wiki.smetj.net/wiki/Nscaweb
the PowerShell script uses cURL (contained in zip file) to send HTTP requests to NSCAweb's local queue which reports to Nagios.
*The default port 5668 should be allowed inbound to the Nagios server if you are checking hosts over the internet
*No ports need to be forwarded on the monitored host's network(Uses HTTP Request to get the info to Nagios)
*The services in Nagios should be set to passive checks only
*Freshness checking should be setup so you are alerted when the passive check does not report in
http://nagios.sourceforge.net/docs/3_0/freshness.html
*the ZIP file contains a task that can be imported and is set to launch the PowerShell script daily at 7:00AM as the system account. The task launches the script from "C:Nagios Windows Backup Script"
*The PowerShell execution policy may need to be changed for the script to run (Set-ExecutionPolicy bypass)
*Launch the PowerShell script manually to troubleshoot
3/22/2012 - Reuploaded script with "wbadmin get versions" uncommented. Had it commented for testing. Sorry.
Please let me know how this is working for you and if you have any suggestions.
Thanks,
Zachary Niezelski
Reviews (2)
byleonux, August 30, 2012
Thanks for a very useful plugin.
The backup check will always fail if you don't have the right date format string, so check the line:
$yesterday = $date_sub1.ToString("M/d/yyyy")
In South Africa we use "yyyy/MM/dd"
The backup check will always fail if you don't have the right date format string, so check the line:
$yesterday = $date_sub1.ToString("M/d/yyyy")
In South Africa we use "yyyy/MM/dd"
I found a bug: In your download there is the line that pulls the history from wbadmin commented out. This should be enabled by default.
Also, you maybe want to use the regional settings in PowerShell to automatically determine the yesterday date value for comparison. Or add a list of known ones (Germany uses dd.MM.yyyy).
Otherwise great!
Also, you maybe want to use the regional settings in PowerShell to automatically determine the yesterday date value for comparison. Or add a list of known ones (Germany uses dd.MM.yyyy).
Otherwise great!
Owner's reply
Meilon,
Thanks for your review. I uploaded the script with that line uncommented. I'll look into the dates and see if I can make it more regional friendly.
Zachary