| 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 | ***************************************************************************/
|
|---|
| 21 | NSC_WRAPPERS_MAIN();
|
|---|
| 22 | NSC_WRAPPERS_CLI();
|
|---|
| 23 |
|
|---|
| 24 | #include <config.h>
|
|---|
| 25 | #include <strEx.h>
|
|---|
| 26 | #include <utils.h>
|
|---|
| 27 | #include <checkHelpers.hpp>
|
|---|
| 28 | #include "TaskSched.h"
|
|---|
| 29 |
|
|---|
| 30 | class CheckTaskSched : public nscapi::impl::simple_command, public nscapi::impl::simple_plugin {
|
|---|
| 31 | private:
|
|---|
| 32 | std::wstring syntax;
|
|---|
| 33 |
|
|---|
| 34 | public:
|
|---|
| 35 | // Module calls
|
|---|
| 36 | bool loadModule();
|
|---|
| 37 | bool loadModuleEx(std::wstring alias, NSCAPI::moduleLoadMode mode);
|
|---|
| 38 | bool unloadModule();
|
|---|
| 39 |
|
|---|
| 40 | std::wstring getModuleName() {
|
|---|
| 41 | return _T("CheckTaskSched");
|
|---|
| 42 | }
|
|---|
| 43 | std::wstring getModuleDescription() {
|
|---|
| 44 | return _T("CheckTaskSched can check various file and disk related things.\nThe current version has commands to check Size of hard drives and directories.");
|
|---|
| 45 | }
|
|---|
| 46 | nscapi::plugin_wrapper::module_version getModuleVersion() {
|
|---|
| 47 | nscapi::plugin_wrapper::module_version version = {0, 0, 1 };
|
|---|
| 48 | return version;
|
|---|
| 49 | }
|
|---|
| 50 |
|
|---|
| 51 | bool hasCommandHandler();
|
|---|
| 52 | bool hasMessageHandler();
|
|---|
| 53 | NSCAPI::nagiosReturn handleCommand(const std::wstring &target, const std::wstring &command, std::list<std::wstring> &arguments, std::wstring &message, std::wstring &perf);
|
|---|
| 54 | int CheckTaskSched::commandLineExec(const wchar_t* command,const unsigned int argLen,wchar_t** args);
|
|---|
| 55 |
|
|---|
| 56 | // Check commands
|
|---|
| 57 | NSCAPI::nagiosReturn TaskSchedule(std::list<std::wstring> arguments, std::wstring &message, std::wstring &perf);
|
|---|
| 58 |
|
|---|
| 59 |
|
|---|
| 60 |
|
|---|
| 61 | private:
|
|---|
| 62 | typedef checkHolders::CheckContainer<checkHolders::MaxMinBoundsDiscSize> PathContainer;
|
|---|
| 63 | typedef checkHolders::CheckContainer<checkHolders::MaxMinPercentageBoundsDiskSize> DriveContainer;
|
|---|
| 64 | };
|
|---|