source: nscp/modules/DebugLogMetrics/DebugLogMetrics.h @ 3692371

0.4.00.4.10.4.2stable
Last change on this file since 3692371 was 3692371, checked in by Michael Medin <michael@…>, 4 years ago

2009-01-20 MickeM

  • Fixed issue with CheckWMI when no filter was specified.

2009-01-17 MickeM

+ Added new command line option pdhlookup (to CheckSystem) to lookup index from names.

Probably not usefull to anyone but me :) Usage: "nsclient++ -noboot CheckSystem pdhlookup Antal bindningsreferenser"

  • Fixed so PDH Collectors use the same exception as the rest of the PDH stuff (might give better errors when PDH breaks, but I doubt it)
  • removed debug output from -noboot + Added new command line option pdhmatch to use pattern matching on PDH queries Usage: nsclient++ -noboot CheckSystem pdhmatch \Process(*)\Antal trådar
  • Improved error reporting in the PDH subsystem. + Added new module A_DebugLogMetrics.dll which can be used to generate debug info. Enable the module and a file called process_info.csv will be created under %APP_DATA%/nsclient++/process_info.csv which contains metrics.
  • Fixed handle leak in CheckExternalProcess? and NRPEListsner (executing commands).

2009-01-13 MickeM

  • Fixed issue with 64-bit installer (now installs under Program Files (and not x86) + Brand new build enviornment based upon boost build!!! Use batch file to build (release-build.bat or modify to make your own)
  • Modified /about so it now shows a lot of usefull(?) info.

2008-11-13 MickeM

+ Added truncate option to checkServiceState

2008-09-24 MickeM

  • Imroved the installer (now auto-updates the version when built)
  • Property mode set to 100644
File size: 2.8 KB
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***************************************************************************/
21
22NSC_WRAPPERS_MAIN();
23#include <map>
24#include <error.hpp>
25#include "PDHCollector.h"
26
27class DebugLogMetrics {
28private:
29        struct command_data {
30                command_data() {}
31                command_data(std::wstring command_, std::wstring arguments_) : command(command_), arguments(arguments_) {}
32                std::wstring command;
33                std::wstring arguments;
34        };
35        typedef std::map<strEx::blindstr, command_data> command_list;
36        command_list commands;
37        command_list alias;
38        unsigned int timeout;
39        std::wstring scriptDirectory_;
40        std::wstring root_;
41        PDHCollectorThread pdhThread;
42
43public:
44        DebugLogMetrics();
45        virtual ~DebugLogMetrics();
46        // Module calls
47        bool loadModule();
48        bool unloadModule();
49
50
51        std::wstring getModuleName() {
52                return _T("Metrics Logger");
53        }
54        NSCModuleWrapper::module_version getModuleVersion() {
55                NSCModuleWrapper::module_version version = {0, 0, 1 };
56                return version;
57        }
58        std::wstring getModuleDescription() {
59                return _T("A module to log metrics to a file to find reasource and memory leaks.");
60        }
61
62        bool hasCommandHandler();
63        bool hasMessageHandler();
64        NSCAPI::nagiosReturn handleCommand(const strEx::blindstr command, const unsigned int argLen, TCHAR **char_args, std::wstring &message, std::wstring &perf);
65        std::wstring getConfigurationMeta();
66
67};
68
Note: See TracBrowser for help on using the repository browser.