aboutsummaryrefslogtreecommitdiffstats
path: root/pingu_host.c
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-10-11 10:01:27 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2011-10-11 10:01:27 +0200
commitc2af879f64bac393df12e593b1bf16cd56517095 (patch)
tree615248654ee7771688a016708fa534e52821f002 /pingu_host.c
parent47d7324b1d92e0a7614a17561e5c2f58b4b466a1 (diff)
downloadpingu-c2af879f64bac393df12e593b1bf16cd56517095.tar.bz2
pingu-c2af879f64bac393df12e593b1bf16cd56517095.tar.xz
pingu_host: use ONLINE/OFFLINE in log message
Diffstat (limited to 'pingu_host.c')
-rw-r--r--pingu_host.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/pingu_host.c b/pingu_host.c
index afb4dd7..c153e3d 100644
--- a/pingu_host.c
+++ b/pingu_host.c
@@ -45,7 +45,7 @@ void execute_action(const char *action)
int pingu_host_set_status(struct pingu_host *host, int status)
{
- const char *action;
+ const char *action, *statusstr = "";
int adjustment;
host->burst.active = 0;
if (host->status == status) {
@@ -53,17 +53,19 @@ int pingu_host_set_status(struct pingu_host *host, int status)
return status;
}
host->status = status;
- log_info("%s: new status: %i", host->label, status);
switch (host->status) {
case PINGU_HOST_STATUS_OFFLINE:
action = host->down_action;
adjustment = -1;
+ statusstr = "OFFLINE";
break;
case PINGU_HOST_STATUS_ONLINE:
action = host->up_action;
adjustment = 1;
+ statusstr = "ONLINE";
break;
}
+ log_info("%s: went %s", host->label, statusstr);
execute_action(action);
pingu_iface_adjust_hosts_online(host->iface, adjustment);