pandorafms/pandora_agents/win32/pandora.h

80 lines
2.2 KiB
C
Raw Normal View History

/* Common functions to any pandora program.
Copyright (C) 2006 Artica ST.
Written by Esteban Sanchez.
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, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __PANDORA__
#define __PANDORA__
#include <list>
#include <string>
#undef WINVER
#define WINVER 0x0500
#include <windows.h>
#include "windows_service.h"
using namespace std;
#define PANDORA_DEBUG 1
2006-08-15 Esteban Sanchez <estebans@artica.es> * autogen.sh, configure.in, Makefile.am, Doxyfile.in: Added to repository. They are used to generate documentation, not to compile. * main.cc: Added some comments. Style correction. * pandora.[cc,h]: Added documentation comments. Changed visibility of some attributes. * pandora_agent_conf.[cc,h]: Added to Pandora namespace. Added documentation comments. * pandora_windows_service.[cc,h], pandora_strutils.[cc,h], windows/pandora_windows_infp.[cc,h], ssh/pandora_ssh_test.[cc,h]: Added documentation comments. * ssh/pandora_ssh_client.[cc,h]:Added documentation comments. Removed old method to connect with user and password. Style correction. * misc/pandora_file.[cc,h]: Added documentation comments. Renamed some parameters. * modules/pandora_module.[cc,h]: Added documentation comments. Put a name to the enumerators. Added a new class to agroupate all exceptions produced by Pandora_Module child class objects. Changed visibility of some attributes. Added some new methods and renamed others. * modules/pandora_module_cpuusage.[cc,h], modules/pandora_module_exec.[cc,h], modules/pandora_module_freememory.[cc,h], modules/pandora_module_freedisk.[cc,h], modules/pandora_module_proc.[cc,h], modules/pandora_module_service.[cc,h]: Added documentation comments. Some changes to adapt the objects to the Pandora_Module changes. * modules/pandora_module_list.[cc,h]: Added documentation comments. Some changes to adapt the objects to the Pandora_Module changes. Added to Pandora_Modules namespace. * windows/pandora_windows_wmi.[cc,h]: Added documentation comments. Renamed Pandora_Wmi_Error to Pandora_Wmi_Exception. * windows_service.[cc,h]: Added documentation comments. Changed visibility of some attributes. Style correction. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@150 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2006-08-25 15:02:03 +02:00
/**
* Main application.
*/
namespace Pandora {
2006-08-15 Esteban Sanchez <estebans@artica.es> * autogen.sh, configure.in, Makefile.am, Doxyfile.in: Added to repository. They are used to generate documentation, not to compile. * main.cc: Added some comments. Style correction. * pandora.[cc,h]: Added documentation comments. Changed visibility of some attributes. * pandora_agent_conf.[cc,h]: Added to Pandora namespace. Added documentation comments. * pandora_windows_service.[cc,h], pandora_strutils.[cc,h], windows/pandora_windows_infp.[cc,h], ssh/pandora_ssh_test.[cc,h]: Added documentation comments. * ssh/pandora_ssh_client.[cc,h]:Added documentation comments. Removed old method to connect with user and password. Style correction. * misc/pandora_file.[cc,h]: Added documentation comments. Renamed some parameters. * modules/pandora_module.[cc,h]: Added documentation comments. Put a name to the enumerators. Added a new class to agroupate all exceptions produced by Pandora_Module child class objects. Changed visibility of some attributes. Added some new methods and renamed others. * modules/pandora_module_cpuusage.[cc,h], modules/pandora_module_exec.[cc,h], modules/pandora_module_freememory.[cc,h], modules/pandora_module_freedisk.[cc,h], modules/pandora_module_proc.[cc,h], modules/pandora_module_service.[cc,h]: Added documentation comments. Some changes to adapt the objects to the Pandora_Module changes. * modules/pandora_module_list.[cc,h]: Added documentation comments. Some changes to adapt the objects to the Pandora_Module changes. Added to Pandora_Modules namespace. * windows/pandora_windows_wmi.[cc,h]: Added documentation comments. Renamed Pandora_Wmi_Error to Pandora_Wmi_Exception. * windows_service.[cc,h]: Added documentation comments. Changed visibility of some attributes. Style correction. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@150 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2006-08-25 15:02:03 +02:00
/**
* A Key_Value object holds a relation between a value and a
* unique key value.
*/
class Key_Value {
private:
2006-08-15 Esteban Sanchez <estebans@artica.es> * autogen.sh, configure.in, Makefile.am, Doxyfile.in: Added to repository. They are used to generate documentation, not to compile. * main.cc: Added some comments. Style correction. * pandora.[cc,h]: Added documentation comments. Changed visibility of some attributes. * pandora_agent_conf.[cc,h]: Added to Pandora namespace. Added documentation comments. * pandora_windows_service.[cc,h], pandora_strutils.[cc,h], windows/pandora_windows_infp.[cc,h], ssh/pandora_ssh_test.[cc,h]: Added documentation comments. * ssh/pandora_ssh_client.[cc,h]:Added documentation comments. Removed old method to connect with user and password. Style correction. * misc/pandora_file.[cc,h]: Added documentation comments. Renamed some parameters. * modules/pandora_module.[cc,h]: Added documentation comments. Put a name to the enumerators. Added a new class to agroupate all exceptions produced by Pandora_Module child class objects. Changed visibility of some attributes. Added some new methods and renamed others. * modules/pandora_module_cpuusage.[cc,h], modules/pandora_module_exec.[cc,h], modules/pandora_module_freememory.[cc,h], modules/pandora_module_freedisk.[cc,h], modules/pandora_module_proc.[cc,h], modules/pandora_module_service.[cc,h]: Added documentation comments. Some changes to adapt the objects to the Pandora_Module changes. * modules/pandora_module_list.[cc,h]: Added documentation comments. Some changes to adapt the objects to the Pandora_Module changes. Added to Pandora_Modules namespace. * windows/pandora_windows_wmi.[cc,h]: Added documentation comments. Renamed Pandora_Wmi_Error to Pandora_Wmi_Exception. * windows_service.[cc,h]: Added documentation comments. Changed visibility of some attributes. Style correction. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@150 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2006-08-25 15:02:03 +02:00
string key;
string value;
public:
void parseLine (string str);
string getKey ();
string getValue ();
};
static const HKEY hkey = HKEY_LOCAL_MACHINE;
const char * const name = "PandoraFMSAgent";
const char * const display_name = "Pandora FMS agent";
const char * const description = "The Pandora FMS Agent service";
2006-08-15 Esteban Sanchez <estebans@artica.es> * autogen.sh, configure.in, Makefile.am, Doxyfile.in: Added to repository. They are used to generate documentation, not to compile. * main.cc: Added some comments. Style correction. * pandora.[cc,h]: Added documentation comments. Changed visibility of some attributes. * pandora_agent_conf.[cc,h]: Added to Pandora namespace. Added documentation comments. * pandora_windows_service.[cc,h], pandora_strutils.[cc,h], windows/pandora_windows_infp.[cc,h], ssh/pandora_ssh_test.[cc,h]: Added documentation comments. * ssh/pandora_ssh_client.[cc,h]:Added documentation comments. Removed old method to connect with user and password. Style correction. * misc/pandora_file.[cc,h]: Added documentation comments. Renamed some parameters. * modules/pandora_module.[cc,h]: Added documentation comments. Put a name to the enumerators. Added a new class to agroupate all exceptions produced by Pandora_Module child class objects. Changed visibility of some attributes. Added some new methods and renamed others. * modules/pandora_module_cpuusage.[cc,h], modules/pandora_module_exec.[cc,h], modules/pandora_module_freememory.[cc,h], modules/pandora_module_freedisk.[cc,h], modules/pandora_module_proc.[cc,h], modules/pandora_module_service.[cc,h]: Added documentation comments. Some changes to adapt the objects to the Pandora_Module changes. * modules/pandora_module_list.[cc,h]: Added documentation comments. Some changes to adapt the objects to the Pandora_Module changes. Added to Pandora_Modules namespace. * windows/pandora_windows_wmi.[cc,h]: Added documentation comments. Renamed Pandora_Wmi_Error to Pandora_Wmi_Exception. * windows_service.[cc,h]: Added documentation comments. Changed visibility of some attributes. Style correction. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@150 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2006-08-25 15:02:03 +02:00
void setPandoraInstallDir (string dir);
string getPandoraInstallDir ();
void setPandoraInstallPath (string path);
string getPandoraInstallPath ();
void setPandoraDebug (bool dbg);
bool getPandoraDebug ();
string getPandoraAgentVersion ();
void pandoraDebug (char *format, ...);
void pandoraLog (char *format, ...);
void pandoraFree (void * e);
2006-08-15 Esteban Sanchez <estebans@artica.es> * autogen.sh, configure.in, Makefile.am, Doxyfile.in: Added to repository. They are used to generate documentation, not to compile. * main.cc: Added some comments. Style correction. * pandora.[cc,h]: Added documentation comments. Changed visibility of some attributes. * pandora_agent_conf.[cc,h]: Added to Pandora namespace. Added documentation comments. * pandora_windows_service.[cc,h], pandora_strutils.[cc,h], windows/pandora_windows_infp.[cc,h], ssh/pandora_ssh_test.[cc,h]: Added documentation comments. * ssh/pandora_ssh_client.[cc,h]:Added documentation comments. Removed old method to connect with user and password. Style correction. * misc/pandora_file.[cc,h]: Added documentation comments. Renamed some parameters. * modules/pandora_module.[cc,h]: Added documentation comments. Put a name to the enumerators. Added a new class to agroupate all exceptions produced by Pandora_Module child class objects. Changed visibility of some attributes. Added some new methods and renamed others. * modules/pandora_module_cpuusage.[cc,h], modules/pandora_module_exec.[cc,h], modules/pandora_module_freememory.[cc,h], modules/pandora_module_freedisk.[cc,h], modules/pandora_module_proc.[cc,h], modules/pandora_module_service.[cc,h]: Added documentation comments. Some changes to adapt the objects to the Pandora_Module changes. * modules/pandora_module_list.[cc,h]: Added documentation comments. Some changes to adapt the objects to the Pandora_Module changes. Added to Pandora_Modules namespace. * windows/pandora_windows_wmi.[cc,h]: Added documentation comments. Renamed Pandora_Wmi_Error to Pandora_Wmi_Exception. * windows_service.[cc,h]: Added documentation comments. Changed visibility of some attributes. Style correction. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@150 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2006-08-25 15:02:03 +02:00
/**
* Super-class exception.
*
* Other exceptions generated in the application should inherate from
* this class. This allow a easier handling on throw and catch blocks.
*/
class Pandora_Exception { };
}
#endif /* __PANDORA_H__ */