PROXY  WHOIS  RQUOTE  TEXTS  SOFT  FOREX  BBOARD
 Music  Philosophy  Code  Literature  Russian

= ROOT|Technical|Code_Examples|C|nagios-plugins-1.4.10|plugins|check_ide_smart.c =

page 1 of 6



/******************************************************************************
* Nagios check_ide_smart plugin
*
* License: GPL
*
*  ide-smart 1.3 - IDE S.M.A.R.T. checking tool
*  Copyright (C)  1998-1999 Ragnar Hojland Espinosa <ragnar@lightside.dhis.org>
*                 1998      Gadi Oxman <gadio@netvision.net.il>
* 
* Copyright (c) 2000 Robert Dale <rdale@digital-mission.com>
* Copyright (c) 2000-2006 nagios-plugins team
*
* Last Modified: $Date: 2007-06-13 10:43:28 +0100 (Wed, 13 Jun 2007) $
*
* Description:
*
* This file contains the check_ide_smart plugin
*
*  This plugin checks a local hard drive with the (Linux specific) SMART interface
*
*
* License Information:
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 * $Id: check_ide_smart.c 1739 2007-06-13 09:43:28Z psychotrahe $
 */

const char *progname = "check_ide_smart";
const char *revision = "$Revision: 1739 $";
const char *copyright = "2000-2006";
const char *email = "nagiosplug-devel@lists.sourceforge.net";
	
#include "common.h"
#include "utils.h"

void print_help (void);
void print_usage (void);

#include <sys/stat.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <linux/hdreg.h>
#include <linux/types.h>
#include <errno.h>
	
#define NR_ATTRIBUTES	30
	
#ifndef TRUE
#define TRUE 1
#endif	/*  */
	
#define PREFAILURE 2
#define ADVISORY 1
#define OPERATIONAL 0
#define UNKNOWN -1

typedef struct threshold_s
{
	__u8 id;
	__u8 threshold;
	__u8 reserved[10];
}
__attribute__ ((packed)) threshold_t;

typedef struct thresholds_s
{
	__u16 revision;
	threshold_t thresholds[NR_ATTRIBUTES];
	__u8 reserved[18];
	__u8 vendor[131];
	__u8 checksum;
}
__attribute__ ((packed)) thresholds_t;

typedef struct value_s
{
	__u8 id;
	__u16 status;
	__u8 value;
	__u8 vendor[8];
}
__attribute__ ((packed)) value_t;

typedef struct values_s
{
	__u16 revision;
	value_t values[NR_ATTRIBUTES];
=1=

= PAGE 1 = NEXT > |2|3|4|5|6

UP TO ROOT | UP TO DIR

Google
 


E-mail Facebook Google Digg del.icio.us BlinkList Fark Furl Ma.gnolia Netscape NewsVine Reddit Slashdot Spurl StumbleUpon Technorati YahooMyWeb LiveJournal Blogmarks TwitThis Live News2.ru BobrDobr.ru Memori.ru MoeMesto.ru

0.01965 wallclock secs ( 0.00 usr + 0.00 sys = 0.00 CPU)