Use APPSERVER_PROBE_NAME for the service name

This commit is contained in:
Pierre Pronchery 2022-05-22 04:30:34 +02:00
parent 4e8f4d4c97
commit 7d3623fab3
3 changed files with 15 additions and 7 deletions

View File

@ -21,10 +21,14 @@
#include <System/App.h>
#include "rrd.h"
#include "damon.h"
#include "../config.h"
/* constants */
#ifndef APPSERVER_PROBE_NAME
# define APPSERVER_PROBE_NAME PACKAGE
#endif
#ifndef PROGNAME_DAMON
# define PROGNAME_DAMON "DaMon"
# define PROGNAME_DAMON "DaMon"
#endif
#define DAMON_SEP '/'
@ -113,8 +117,8 @@ static AppClient * _refresh_connect(Host * host, Event * event)
{
if(setenv("APPSERVER_Probe", host->hostname, 1) != 0)
return NULL;
if((host->appclient = appclient_new_event(NULL, "Probe", NULL, event))
== NULL)
if((host->appclient = appclient_new_event(NULL, APPSERVER_PROBE_NAME,
NULL, event)) == NULL)
error_print(PROGNAME_DAMON);
return host->appclient;
}

View File

@ -30,8 +30,11 @@
#include "../data/Probe.h"
#include "../config.h"
#ifndef APPSERVER_PROBE_NAME
# define APPSERVER_PROBE_NAME PACKAGE
#endif
#ifndef PROGNAME_PROBE
# define PROGNAME_PROBE PACKAGE
# define PROGNAME_PROBE PACKAGE
#endif
@ -685,8 +688,9 @@ static int _probe(AppServerOptions options)
free(probe.volinfo);
return _probe_error(1);
}
if((appserver = appserver_new_event(&probe, options, "Probe", NULL,
event)) == NULL)
if((appserver = appserver_new_event(&probe, options,
APPSERVER_PROBE_NAME, NULL, event))
== NULL)
{
free(probe.ifinfo);
free(probe.volinfo);

View File

@ -30,7 +30,7 @@ install=$(BINDIR)
depends=damon.h,rrd.h,../config.h
[damon-backend.c]
depends=damon.h,rrd.h,damon-backend-app.c,damon-backend-salt.c
depends=damon.h,rrd.h,damon-backend-app.c,damon-backend-salt.c,../config.h
[damon-main.c]
depends=damon.h