[Nagiosplug-checkins] nagiosplug/plugins check_disk.c,1.77,1.78
Ton Voon
tonvoon at users.sourceforge.net
Wed Oct 18 14:12:13 CEST 2006
- Previous message: [Nagiosplug-checkins] nagiosplug/plugins/t check_disk.t,1.13,1.14
- Next message: [Nagiosplug-checkins] nagiosplug/plugins check_apt.c, 1.6, 1.7 check_by_ssh.c, 1.38, 1.39 check_dig.c, 1.44, 1.45 check_dns.c, 1.53, 1.54 check_dummy.c, 1.16, 1.17 check_fping.c, 1.26, 1.27 check_game.c, 1.27, 1.28 check_hpjd.c, 1.33, 1.34 check_http.c, 1.91, 1.92 check_ide_smart.c, 1.11, 1.12 check_ldap.c, 1.31, 1.32 check_load.c, 1.31, 1.32 check_mrtg.c, 1.26, 1.27 check_mrtgtraf.c, 1.24, 1.25 check_mysql.c, 1.32, 1.33 check_mysql_query.c, 1.4, 1.5 check_nagios.c, 1.30, 1.31 check_nt.c, 1.41, 1.42 check_ntp.c, 1.10, 1.11 check_nwstat.c, 1.33, 1.34 check_overcr.c, 1.20, 1.21 check_pgsql.c, 1.33, 1.34 check_ping.c, 1.51, 1.52 check_procs.c, 1.52, 1.53
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv8570
Modified Files:
check_disk.c
Log Message:
Re-added perf data to check_disk
Index: check_disk.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_disk.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -d -r1.77 -r1.78
--- check_disk.c 12 Oct 2006 14:14:47 -0000 1.77
+++ check_disk.c 18 Oct 2006 12:12:11 -0000 1.78
@@ -159,6 +159,8 @@
double dfree_pct = -1, dused_pct = -1;
double dused_units, dfree_units, dtotal_units;
double dused_inodes_percent, dfree_inodes_percent;
+ double warning_high_tide = UINT_MAX;
+ double critical_high_tide = UINT_MAX;
int temp_result;
struct mount_entry *me;
@@ -284,13 +286,30 @@
result = max_state(result, disk_result);
+ /* What a mess of units. The output shows free space, the perf data shows used space. Yikes!
+ Hack here. Trying to get warn/crit levels from freespace_(units|percent) for perf
+ data. Assumption that start=0. Roll on new syntax...
+ */
+ if (path->freespace_units->warning != NULL) {
+ warning_high_tide = dtotal_units - path->freespace_units->warning->end;
+ }
+ if (path->freespace_percent->warning != NULL) {
+ warning_high_tide = abs( min( (double) warning_high_tide, (double) (1.0 - path->freespace_percent->warning->end/100)*dtotal_units ));
+ }
+ if (path->freespace_units->critical != NULL) {
+ critical_high_tide = dtotal_units - path->freespace_units->critical->end;
+ }
+ if (path->freespace_percent->critical != NULL) {
+ critical_high_tide = abs( min( (double) critical_high_tide, (double) (1.0 - path->freespace_percent->critical->end/100)*dtotal_units ));
+ }
+
asprintf (&perf, "%s %s", perf,
perfdata ((!strcmp(me->me_mountdir, "none") || display_mntp) ? me->me_devname : me->me_mountdir,
dused_units, units,
- FALSE, 0, /* min ((uintmax_t)dtotal_units-(uintmax_t)w_df, (uintmax_t)((1.0-w_dfp/100.0)*dtotal_units)), */
- FALSE, 0, /* min ((uintmax_t)dtotal_units-(uintmax_t)c_df, (uintmax_t)((1.0-c_dfp/100.0)*dtotal_units)), */
- FALSE, 0, /* inode_space_pct - this is not meant to be here???, */
- FALSE, 0));; /* dtotal_units)); */
+ TRUE, warning_high_tide,
+ TRUE, critical_high_tide,
+ TRUE, 0,
+ TRUE, dtotal_units));
if (disk_result==STATE_OK && erronly && !verbose)
continue;
- Previous message: [Nagiosplug-checkins] nagiosplug/plugins/t check_disk.t,1.13,1.14
- Next message: [Nagiosplug-checkins] nagiosplug/plugins check_apt.c, 1.6, 1.7 check_by_ssh.c, 1.38, 1.39 check_dig.c, 1.44, 1.45 check_dns.c, 1.53, 1.54 check_dummy.c, 1.16, 1.17 check_fping.c, 1.26, 1.27 check_game.c, 1.27, 1.28 check_hpjd.c, 1.33, 1.34 check_http.c, 1.91, 1.92 check_ide_smart.c, 1.11, 1.12 check_ldap.c, 1.31, 1.32 check_load.c, 1.31, 1.32 check_mrtg.c, 1.26, 1.27 check_mrtgtraf.c, 1.24, 1.25 check_mysql.c, 1.32, 1.33 check_mysql_query.c, 1.4, 1.5 check_nagios.c, 1.30, 1.31 check_nt.c, 1.41, 1.42 check_ntp.c, 1.10, 1.11 check_nwstat.c, 1.33, 1.34 check_overcr.c, 1.20, 1.21 check_pgsql.c, 1.33, 1.34 check_ping.c, 1.51, 1.52 check_procs.c, 1.52, 1.53
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Commits
mailing list