[nagiosplug] check_disk: die with a reasonable error message ...

"Nagios Plugin Development" <[email protected]> Tue, 17 Sep 2013 21:40:28 +0000
Newsgroups gmane.network.nagios.plugins.cvs
Message-ID <[email protected]>
    Module: nagiosplug
    Branch: master
    Commit: 065905e9002e1c53f82f014dfda3e134c2f9cbf1
    Author: Sven Nierlein <[email protected]>
 Committer: Sven Nierlein <[email protected]>
      Date: Tue Sep 17 20:12:32 2013 +0200
       URL: http://nagiosplug.git.sf.net/git/gitweb.cgi?p=nagiosplug/nagiosplug;a=commit;h=065905e

check_disk: die with a reasonable error message if one mount point hits average value

---

 plugins/t/check_disk.t |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/plugins/t/check_disk.t b/plugins/t/check_disk.t
index 45c6a61..39b4ca9 100644
--- a/plugins/t/check_disk.t
+++ b/plugins/t/check_disk.t
@@ -57,6 +57,9 @@ if ($free_on_mp1 > $free_on_mp2) {
 } else {
 	die "Two mountpoints are the same - cannot do rest of test";
 }
+if($free_on_mp1 == $avg_free || $free_on_mp2 == $avg_free) {
+	die "One mountpoints has average space free - cannot do rest of test";
+}
 
 
 # Do same for inodes
@@ -74,6 +77,9 @@ if ($free_inode_on_mp1 > $free_inode_on_mp2) {
 } else {
 	die "Two mountpoints with same inodes free - cannot do rest of test";
 }
+if($free_inode_on_mp1 == $avg_inode_free || $free_inode_on_mp2 == $avg_inode_free) {
+	die "One mountpoints has average inodes free - cannot do rest of test";
+}
 
 # Verify performance data
 # First check absolute thresholds...


------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk