The Assimilation Project  based on Assimilation version 1.1.7.1474836767

Class implementing resource commands. More...

Collaboration diagram for ResourceNAGIOS class:

Functions

FSTATIC void _resourcenagios_finalize (AssimObj *aself)
 Finalize function for ResourceNAGIOS objects. More...
 
FSTATIC void _resourcenagios_execute (ResourceCmd *cmdself)
 Do the deed, dude! More...
 
FSTATIC void _resourcenagios_child_notify (ChildProcess *child, enum HowDied exittype, int rc, int signal, gboolean core_dumped)
 We get called when our child exits, times out and is killed, or times out and can't be killed. More...
 
FSTATIC char ** _resourcenagios_create_argv (char *argv0,GSList *argv_in)
 Create command line arguments for our child process. More...
 
FSTATIC void _resourcenagios_init_environ (ResourceNAGIOS *self)
 
ResourceCmdresourcenagios_new (guint structsize, ConfigContext *request, gpointer user_data, ResourceCmdCallback callback)
 Constructor for ResourceNAGIOS class. More...
 
#define REQNAGIOSPATH   "nagiospath"
 
typedef struct _ResourceNAGIOS ResourceNAGIOS
 

Detailed Description

Class implementing resource commands.

Macro Definition Documentation

#define REQNAGIOSPATH   "nagiospath"

It does not implement any queueing, repeating events or such things. It creates an object which will execute the resource action immediately when asked. If this class invoked without any sort of queueing mechanism, or other safeguards it can break the semantics of the underlying resources.

Resources are expected to assume that no more than one resource action can be active at a time for any given resource instance.

Definition at line 43 of file resourcenagios.h.

Referenced by resourcenagios_new().

Typedef Documentation

Definition at line 45 of file resourcenagios.h.

Function Documentation

FSTATIC void _resourcenagios_child_notify ( ChildProcess child,
enum HowDied  exittype,
int  rc,
int  signal,
gboolean  core_dumped 
)

We get called when our child exits, times out and is killed, or times out and can't be killed.

We may eventually need to map exit codes between the Nagios-API exit codes and our idea of what exit codes mean.

Definition at line 321 of file resourcenagios.c.

References __FUNCTION__, CASTTOCLASS, DEBUGMSG2, DEBUGMSG5, EXITED_ZERO, g_get_monotonic_time(), MONITOROP, UNREF2, and _ChildProcess::user_data.

Referenced by _resourcenagios_execute().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC char ** _resourcenagios_create_argv ( char *  argv0,
GSList *  argv_in 
)

Create command line arguments for our child process.

Parameters
argv0The string we want for argv[0] in our result
argv_inLinked list of all our other arguments

Definition at line 149 of file resourcenagios.c.

References __FUNCTION__, _ConfigValue::addrvalue, _NetAddr::baseclass, CASTTOCLASS, CFG_NETADDR, CFG_STRING, configcontext_elem_toString(), DEBUG, FSTATIC, MALLOC, _ConfigValue::strvalue, _AssimObj::toString, _ConfigValue::u, and _ConfigValue::valtype.

Referenced by resourcenagios_new().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC void _resourcenagios_execute ( ResourceCmd self)

Do the deed, dude!

< cpsize

< char** argv,

< const char** envp

< ConfigContext* envmod

< const char* curdir

< void (notify)(ChildProcess,enum HowDied,int rc,int signal,gboolean core_dumped)

< gboolean save_stdout

< const char * logdomain

< const char * logprefix

< GLogLevelFlags loglevel

< guint32 timeout_seconds,

< gpointer user_data

< enum ChildErrLogMode errlogmode

< const char * loggingname

Definition at line 264 of file resourcenagios.c.

References __FUNCTION__, _resourcenagios_child_notify(), CASTTOCLASS, CHILD_LOGALL, CHILD_NOLOG, childprocess_new(), DEBUGMSG, DEBUGMSG3, DEBUGMSG5, FSTATIC, g_get_monotonic_time(), REF2, and UNREF.

Referenced by resourcenagios_new().

Here is the call graph for this function:

Here is the caller graph for this function:

void _resourcenagios_finalize ( AssimObj aself)

Finalize function for ResourceNAGIOS objects.

Definition at line 231 of file resourcenagios.c.

References __FUNCTION__, CASTTOCLASS, DEBUGMSG, DEBUGMSG2, DEBUGMSG5, FSTATIC, and UNREF.

Referenced by resourcenagios_new().

Here is the caller graph for this function:

FSTATIC void _resourcenagios_init_environ ( ResourceNAGIOS self)

Definition at line 193 of file resourcenagios.c.

References _ConfigContext::baseclass, _ConfigContext::getstring, _ConfigContext::keys, and REQENVIRONNAMEFIELD.

Referenced by resourcenagios_new().

Here is the caller graph for this function:

ResourceCmd* resourcenagios_new ( guint  structsize,
ConfigContext request,
gpointer  user_data,
ResourceCmdCallback  callback 
)

Constructor for ResourceNAGIOS class.

Its main function is to validate that this type of NAGIOS resource agent exists. It will return NULL if this type of NAGIOS RA doesn't exist.

Parameters
structsizeStructure size (or zero)
requestRequest to instantiate
user_dataUser data for 'callback'
callbackCallback when complete

Definition at line 50 of file resourcenagios.c.

References __FUNCTION__, _AssimObj::_finalize, _resourcenagios_create_argv(), _resourcenagios_execute(), _resourcenagios_finalize(), _resourcenagios_init_environ(), _ResourceCmd::baseclass, BINDDEBUG, CASTTOCLASS, CFG_ARRAY, CFG_CFGCTX, CFG_EEXIST, CFG_STRING, configcontext_new(), CONFIGNAME_TYPE, _ResourceCmd::execute, FSTATIC, _ConfigContext::getarray, _ConfigContext::getstring, _ConfigContext::gettype, NEWSUBCLASS, REQARGVNAMEFIELD, REQENVIRONNAMEFIELD, REQNAGIOSPATH, resourcecmd_constructor(), _ConfigValue::strvalue, _ConfigValue::u, and _ConfigValue::valtype.

Here is the call graph for this function: