check_disk plugin request for modification

Potter, G M (Greg) GPotter at MarathonOil.com
Thu Jan 30 18:27:46 CET 2003


I would like to propose the following modification to the check_disk plugin.
I recommend the addition of a filesystem type argument.  That way if you
are interested in all of the local disks on a system of a particular type,
say ufs or NFS or etc ... you can get them with only one service check.  It
could be called as follows:

$NAGIOS_HOME/libexec/check_disk -w 20 -c 5 -F ufs

The output would look like this:

DISK OK - [1671397 kB (45%) free on /dev/dsk/c0t0d0s0] [8919218 kB (51%) free on /dev/dsk/c1t3d0s7] [13286705 kB (84%) free on /dev/dsk/c1t8d0s6]

or this:
$NAGIOS_HOME/libexec/check_disk -w 20 -c 5 -F nfs

DISK OK - [20093957 kB (14%) free on okcu09:/moc/okc/okcu09/vol1/home/tc8] [20093957 kB (14%) free on okcu09:/moc/okc/okcu09/vol1/home/nagios] [47978332 kB (19%) free on okcu09:/moc/okc/okcu09/vol3/apps/SunOS/OW6] [16588315 kB (96%) free on okcu10:/moc/okc/okcu10/db1/oracle816] [47978332 kB (19%) free on okcu09:/moc/okc/okcu09/vol3/apps/SunOS/nagios] [47978332 kB (19%) free on okcu09:/moc/okc/okcu09/vol3/apps/common]

Here is the diff of check_disk.c and check_disk_fstype.c :

56d55
< char *fstype = "";
78c77
< 	asprintf (&command_line, "%s %s %s", DF_COMMAND, path, fstype);
---
> 	asprintf (&command_line, "%s %s", DF_COMMAND, path);
155d153
< 		{"fstype", required_argument, 0, 'F'},
174c172
< 			getopt_long (argc, argv, "Vhvt:c:w:p:F:m", long_options, &option_index);
---
> 			getopt_long (argc, argv, "Vhvt:c:w:p:m", long_options, &option_index);
176c174
< 		c = getopt (argc, argv, "Vhvt:c:w:p:F:m");
---
> 		c = getopt (argc, argv, "Vhvt:c:w:p:m");
226,228d223
< 		case 'F':									/* Filesystem Type*/
< 			asprintf (&fstype, "-F %s", optarg);
< 			break;



Please let me know what you think about the addition to the plugin.

Thanks!

Greg M. Potter
mailto:gpotter at marathonoil.com


Non Scio, id est in Latina!
               ~~|\
               / | \           
     ~^~^~^~  /  |  \ ~^~^~^~^
      ~^~^~  / 9255  ) ~^~^^~~^^~^
    ~^~^____/____|____)_____^~^^~^~^~^
   ~^~^ \   Greg Potter    / ^~^~^~^~^~^~^
 ~^~^~^~^\_Okla. City, OK_/~^~^~^~^~^~~^~^~^~



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com




More information about the Users mailing list