summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2019-02-14 10:07:17 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2019-02-14 10:07:17 (GMT)
commitfe4dd5c7fe77591ee8d7780d3f5e2e9b9334c2c5 (patch) (side-by-side diff)
treeba465cbde75e7f2e7dd5216246713bf6003a1bfd
parent45c6086f8c0c0f6fe1a46b950682abfdbf104687 (diff)
downloadvarnish-mib-fe4dd5c7fe77591ee8d7780d3f5e2e9b9334c2c5.tar.gz
varnish-mib-fe4dd5c7fe77591ee8d7780d3f5e2e9b9334c2c5.tar.bz2
Minor changes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/ban.c10
-rw-r--r--src/betab.c8
-rw-r--r--src/main.c6
-rw-r--r--src/varnish-mib.88
-rw-r--r--src/vcli.c16
5 files changed, 23 insertions, 25 deletions
diff --git a/src/ban.c b/src/ban.c
index a50b5a3..02ae979 100644
--- a/src/ban.c
+++ b/src/ban.c
@@ -1,5 +1,5 @@
/* This file is part of varnish-mib -*- c -*-
- Copyright (C) 2014-2018 Sergey Poznyakoff
+ Copyright (C) 2014-2019 Sergey Poznyakoff
Varnish-mib is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -51,7 +51,7 @@ varnish_ban(netsnmp_agent_request_info *reqinfo,
}
memcpy(expr, requests->requestvb->val.string, len);
expr[len] = 0;
- DEBUGMSGTL(("varnish_mib:ban", "setting ban %s\n", expr));
+ DEBUGMSGTL(("ban", "setting ban %s\n", expr));
rc = vcli_connect(vsm, &conn);
if (rc == SNMP_ERR_NOERROR) {
rc = send_ban_cmd(&conn, expr);
@@ -119,7 +119,7 @@ banTable_load(netsnmp_cache *cache, void *vmagic)
if (!vsm)
return SNMP_ERR_GENERR;
- DEBUGMSGTL(("varnish_mib:ban", "reloading ban table\n"));
+ DEBUGMSGTL(("ban", "reloading ban table\n"));
rc = vcli_connect(vsm, &conn);
if (rc != SNMP_ERR_NOERROR)
@@ -229,7 +229,7 @@ banTable_load(netsnmp_cache *cache, void *vmagic)
p = q;
}
vcli_disconnect(&conn);
- DEBUGMSGTL(("varnish_mib:ban", "loaded %ld ban entries\n", idx));
+ DEBUGMSGTL(("ban", "loaded %ld ban entries\n", idx));
return 0;
}
@@ -239,7 +239,7 @@ banTable_free(netsnmp_cache *cache, void *vmagic)
netsnmp_tdata *table = (netsnmp_tdata *) vmagic;
netsnmp_tdata_row *row;
- DEBUGMSGTL(("varnish_mib:ban", "freeing ban table\n"));
+ DEBUGMSGTL(("ban", "freeing ban table\n"));
while ((row = netsnmp_tdata_row_first(table))) {
struct banTable_entry *entry = row->data;
free(entry->banExpression);
diff --git a/src/betab.c b/src/betab.c
index 768503a..c472b9d 100644
--- a/src/betab.c
+++ b/src/betab.c
@@ -1,5 +1,5 @@
/* This file is part of varnish-mib
- Copyright (C) 2014, 2018 Sergey Poznyakoff
+ Copyright (C) 2014-2019 Sergey Poznyakoff
Varnish-mib is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -136,7 +136,7 @@ backendTable_load(netsnmp_cache *cache, void *vmagic)
netsnmp_tdata *table_data = (netsnmp_tdata *) vmagic;
struct backend_dfn *dfn;
- DEBUGMSGTL(("varnish_mib:backend", "loading backend table\n"));
+ DEBUGMSGTL(("backend", "loading backend table\n"));
VTAILQ_FOREACH(dfn, &backends, list) {
int i;
@@ -182,7 +182,7 @@ backendTable_free(netsnmp_cache *cache, void *vmagic)
netsnmp_tdata *table = (netsnmp_tdata *) vmagic;
netsnmp_tdata_row *row;
- DEBUGMSGTL(("varnish_mib:backend", "freeing backend table\n"));
+ DEBUGMSGTL(("backend", "freeing backend table\n"));
while ((row = netsnmp_tdata_row_first(table))) {
struct backendTable_entry *entry = row->data;
free(entry->vbeIdent);
@@ -334,7 +334,7 @@ backend_collect_addr(struct vsm *vsm)
struct backend_name_list namelist
= VTAILQ_HEAD_INITIALIZER(namelist);
- DEBUGMSGTL(("varnish_mib:backend", "getting backend info\n"));
+ DEBUGMSGTL(("backend", "getting backend info\n"));
rc = vcli_connect(vsm, &conn);
if (rc != SNMP_ERR_NOERROR)
diff --git a/src/main.c b/src/main.c
index a8d089f..01a24a9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -161,6 +161,9 @@ main(int argc, char **argv)
netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
NETSNMP_DS_AGENT_ROLE, 1);
+ if (!log_set)
+ snmp_enable_stderrlog();
+
SOCK_STARTUP;
init_agent(progname);
init_varnish_mib();
@@ -182,9 +185,6 @@ main(int argc, char **argv)
snmp_enable_syslog_ident(progname, LOG_DAEMON);
snmp_disable_stderrlog();
}
- } else {
- if (!log_set)
- snmp_enable_stderrlog();
}
pidfile_create(pid_file);
diff --git a/src/varnish-mib.8 b/src/varnish-mib.8
index 0856c69..3dc28d8 100644
--- a/src/varnish-mib.8
+++ b/src/varnish-mib.8
@@ -120,18 +120,18 @@ are:
.B varnish_mib
Produces general debugging information.
.TP
-.B varnish_mib:ban
+.B ban
Outputs verbose report about loading th ban table.
.TP
-.B varnish_mib:vcli
+.B vcli
Displays additional information regarding varnish
.B CLI
interaction.
.TP
-.B varnish_mib:vcli:transcript
+.B vcli:transcript
Enables full transcript of varnish CLI session.
.TP
-.B varnish_mib:backend
+.B backend
Outputs verbose information about loading the backend information.
.RE
.TP
diff --git a/src/vcli.c b/src/vcli.c
index 94f0eef..8669446 100644
--- a/src/vcli.c
+++ b/src/vcli.c
@@ -1,5 +1,5 @@
/* This file is part of varnish-mib -*- c -*-
- Copyright (C) 2014-2018 Sergey Poznyakoff
+ Copyright (C) 2014-2019 Sergey Poznyakoff
Varnish-mib is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -199,7 +199,7 @@ vcli_read(struct vcli_conn *conn, size_t size)
if (conn->bufsize == 0)
ret = -1;
conn->base[conn->bufsize] = 0;
- DEBUGMSGTL(("varnish_mib:vcli:transcript", "<<varnish: %s\n", conn->base));
+ DEBUGMSGTL(("vcli:transcript", "<<varnish: %s\n", conn->base));
}
return ret;
@@ -282,7 +282,7 @@ vcli_write(struct vcli_conn *conn)
{
size_t size;
- DEBUGMSGTL(("varnish_mib:vcli:transcript", ">>varnish: %s\n", conn->base));
+ DEBUGMSGTL(("vcli:transcript", ">>varnish: %s\n", conn->base));
for (size = 0; size < conn->bufsize; ) {
int n = write(conn->fd, conn->base + size,
conn->bufsize - size);
@@ -490,8 +490,7 @@ static int
parse_connection(struct vsm *vsm, vcli_sockaddr_t *addr, char **secret)
{
if (vcli_sockaddr) {
- DEBUGMSGTL(("varnish_mib:vcli",
- "using configured sockaddr\n"));
+ DEBUGMSGTL(("vcli", "using configured sockaddr\n"));
*addr = vcli_sockaddr_dup(vcli_sockaddr);
} else {
char *T_arg, *p;
@@ -503,7 +502,7 @@ parse_connection(struct vsm *vsm, vcli_sockaddr_t *addr, char **secret)
p = T_arg + strlen(T_arg) - 1;
if (*p == '\n')
*p = 0;
- DEBUGMSGTL(("varnish_mib:vcli", "-T '%s'\n", T_arg));
+ DEBUGMSGTL(("vcli", "-T '%s'\n", T_arg));
*addr = vcli_parse_sockaddr(T_arg);
free(T_arg);
}
@@ -511,8 +510,7 @@ parse_connection(struct vsm *vsm, vcli_sockaddr_t *addr, char **secret)
return SNMP_ERR_GENERR;
if (vcli_secret) {
- DEBUGMSGTL(("varnish_mib:vcli",
- "using configured secret\n"));
+ DEBUGMSGTL(("vcli", "using configured secret\n"));
*secret = strdup(vcli_secret);
if (!*secret) {
snmp_log(LOG_ERR, "out of memory");
@@ -524,7 +522,7 @@ parse_connection(struct vsm *vsm, vcli_sockaddr_t *addr, char **secret)
snmp_log(LOG_ERR, "no -S arg in shared memory\n");
return SNMP_ERR_GENERR;
}
- DEBUGMSGTL(("varnish_mib:vcli", "-S '%s'\n", S_arg));
+ DEBUGMSGTL(("vcli", "-S '%s'\n", S_arg));
*secret = S_arg;
}
return 0;

Return to:

Send suggestions and report system problems to the System administrator.