root/branches/stable/modules/CheckDisk/CheckDisk.h @ 261

Revision 261, 3.3 KB (checked in by mickem, 6 months ago)

+ Added new option append-filter-<key>=<value> to CheckEventLog to allow "and" of filter rules.

CheckEventLog file=application file=system filter=out MaxWarn=1 MaxCrit=1 filter-eventID=ne:1 filter-eventID=eq:1 append-filter-eventSource==SecurityCenter? truncate=1023 unique descriptions "syntax=%source%: %id% (%count%)"

+ Added debug option to CheckEventLog (to allow settingdebug on per-check)
+ Added obfuscated_password to NSCA section
+ Added so "global" ([Settings] password=...) passwords are read from the NSCA module

Also various changes to make it build with latest version of boost build.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1/**************************************************************************
2*   Copyright (C) 2004-2007 by Michael Medin <michael@medin.name>         *
3*                                                                         *
4*   This code is part of NSClient++ - http://trac.nakednuns.org/nscp      *
5*                                                                         *
6*   This program is free software; you can redistribute it and/or modify  *
7*   it under the terms of the GNU General Public License as published by  *
8*   the Free Software Foundation; either version 2 of the License, or     *
9*   (at your option) any later version.                                   *
10*                                                                         *
11*   This program is distributed in the hope that it will be useful,       *
12*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
13*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
14*   GNU General Public License for more details.                          *
15*                                                                         *
16*   You should have received a copy of the GNU General Public License     *
17*   along with this program; if not, write to the                         *
18*   Free Software Foundation, Inc.,                                       *
19*   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
20***************************************************************************/
21NSC_WRAPPERS_MAIN();
22#include <config.h>
23#include <strEx.h>
24#include <utils.h>
25#include <checkHelpers.hpp>
26
27class CheckDisk {
28private:
29        bool show_errors_;
30
31public:
32        CheckDisk();
33        virtual ~CheckDisk();
34        // Module calls
35        bool loadModule();
36        bool unloadModule();
37
38        std::wstring getModuleName() {
39                return _T("CheckDisk");
40        }
41        std::wstring getModuleDescription() {
42                return _T("CheckDisk can check various file and disk related things.\nThe current version has commands to check Size of hard drives and directories.");
43        }
44        NSCModuleWrapper::module_version getModuleVersion() {
45                NSCModuleWrapper::module_version version = {0, 0, 1 };
46                return version;
47        }
48
49        bool hasCommandHandler();
50        bool hasMessageHandler();
51        std::wstring get_filter(unsigned int drvType);
52        NSCAPI::nagiosReturn handleCommand(const strEx::blindstr command, const unsigned int argLen, TCHAR **char_args, std::wstring &message, std::wstring &perf);
53
54        // Check commands
55        NSCAPI::nagiosReturn CheckFileSize(const unsigned int argLen, TCHAR **char_args, std::wstring &message, std::wstring &perf);
56        NSCAPI::nagiosReturn CheckDriveSize(const unsigned int argLen, TCHAR **char_args, std::wstring &message, std::wstring &perf);
57        NSCAPI::nagiosReturn CheckFile(const unsigned int argLen, TCHAR **char_args, std::wstring &message, std::wstring &perf);
58        NSCAPI::nagiosReturn CheckFile2(const unsigned int argLen, TCHAR **char_args, std::wstring &message, std::wstring &perf);
59        NSCAPI::nagiosReturn getFileAge(const unsigned int argLen, TCHAR **char_args, std::wstring &message, std::wstring &perf);
60        NSCAPI::nagiosReturn CheckSingleFile(const unsigned int argLen, TCHAR **char_args, std::wstring &message, std::wstring &perf);
61
62private:
63        typedef checkHolders::CheckContainer<checkHolders::MaxMinBoundsDiscSize> PathContainer;
64        typedef checkHolders::CheckContainer<checkHolders::MaxMinPercentageBoundsDiskSize> DriveContainer;
65};
Note: See TracBrowser for help on using the browser.