summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2014-11-28 10:38:06 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2014-11-28 10:38:06 (GMT)
commita0e9f37c170c6947928676e9d870bd3d7d74a189 (patch) (side-by-side diff)
treeec991276efeaa603d6b66735eccd5dd9039f779a
parent86411752caf12649c48ec741afa89471ca9243ee (diff)
downloadvarnish-mib-a0e9f37c170c6947928676e9d870bd3d7d74a189.tar.gz
varnish-mib-a0e9f37c170c6947928676e9d870bd3d7d74a189.tar.bz2
Clean up debugging output, document debugging tokens.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/ban.c6
-rw-r--r--src/betab.c6
-rw-r--r--src/varnish-mib.810
-rw-r--r--src/varnish_mib.mib2c2
-rw-r--r--src/vcli.c8
5 files changed, 21 insertions, 11 deletions
diff --git a/src/ban.c b/src/ban.c
index 3023838..70ca541 100644
--- a/src/ban.c
+++ b/src/ban.c
@@ -153,7 +153,7 @@ banTable_load(netsnmp_cache *cache, void *vmagic)
char *p;
struct VSM_data *vd;
- DEBUGMSGTL(("varnish_ban", "reloading ban table"));
+ DEBUGMSGTL(("varnish_ban", "reloading ban table\n"));
vd = varnish_get_vsm_data();
rc = vcli_connect(vd, &conn);
if (rc != SNMP_ERR_NOERROR)
@@ -263,7 +263,7 @@ banTable_load(netsnmp_cache *cache, void *vmagic)
p = q;
}
vcli_disconnect(&conn);
- DEBUGMSGTL(("varnish_ban", "loaded %ld ban entries", idx));
+ DEBUGMSGTL(("varnish_ban", "loaded %ld ban entries\n", idx));
return 0;
}
@@ -273,7 +273,7 @@ banTable_free(netsnmp_cache *cache, void *vmagic)
netsnmp_tdata *table = (netsnmp_tdata *) vmagic;
netsnmp_tdata_row *row;
- DEBUGMSGTL(("varnish_ban", "freeing ban table"));
+ DEBUGMSGTL(("varnish_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 3e10a9a..41c18e7 100644
--- a/src/betab.c
+++ b/src/betab.c
@@ -231,11 +231,11 @@ backendTable_load(netsnmp_cache *cache, void *vmagic)
bp.table = (netsnmp_tdata *) vmagic;
memset(&bp.ent, 0, sizeof(bp.ent));
- DEBUGMSGTL(("varnish_ban", "loading backend table"));
+ DEBUGMSGTL(("varnish_ban", "loading backend table\n"));
VSC_Iter(vd, NULL, create_entry_cb, &bp);
/* FIXME: perhaps handle bp.err separately */
if (bp.idx != -1) {
- DEBUGMSGTL(("varnish_ban", "loaded %lu backend entries",
+ DEBUGMSGTL(("varnish_ban", "loaded %lu backend entries\n",
bp.idx + 1));
if (!create_entry(bp.table, bp.idx, &bp.ent))
snmp_log(LOG_ERR, "out of memory\n");
@@ -249,7 +249,7 @@ backendTable_free(netsnmp_cache *cache, void *vmagic)
netsnmp_tdata *table = (netsnmp_tdata *) vmagic;
netsnmp_tdata_row *row;
- DEBUGMSGTL(("varnish_ban", "freeing backend table"));
+ DEBUGMSGTL(("varnish_ban", "freeing backend table\n"));
while ((row = netsnmp_tdata_row_first(table))) {
struct backendTable_entry *entry = row->data;
free(entry->vbeIdent);
diff --git a/src/varnish-mib.8 b/src/varnish-mib.8
index 05fa177..cc3276b 100644
--- a/src/varnish-mib.8
+++ b/src/varnish-mib.8
@@ -61,6 +61,16 @@ Default is 5 seconds.
.TP
\fBvarnishBackendTableTimeout\fR \fINUMBER\fR
Update interval for \fBbackendTable\fR. Default is 5 seconds.
+.SH DEBUGGING
+The module defines the following debugging tokens:
+.TP
+.B varnish_ban
+Enables general debugging information.
+.TP
+.B varnish_mib:vcli
+Varnish
+.B CLI
+interaction.
.SH OIDS
The following OIDs are defined:
.SS Branch \(dqclient\(dq
diff --git a/src/varnish_mib.mib2c b/src/varnish_mib.mib2c
index 6452ac2..ae344be 100644
--- a/src/varnish_mib.mib2c
+++ b/src/varnish_mib.mib2c
@@ -501,7 +501,7 @@ initialize_table_$i(void)
netsnmp_table_registration_info *table_info;
netsnmp_cache *cache;
- DEBUGMSGTL(("${name}:init", "initializing table $i\n"));
+ DEBUGMSGTL(("${modulename}", "initializing table $i\n"));
reg = netsnmp_create_handler_registration("$i", handle_table_${i},
${i}_oid, ${i}_oid_len,
diff --git a/src/vcli.c b/src/vcli.c
index 6e7bbec..76f869a 100644
--- a/src/vcli.c
+++ b/src/vcli.c
@@ -146,7 +146,7 @@ vcli_read(struct vcli_conn *conn, size_t size)
if (conn->bufsize == 0)
ret = -1;
conn->base[conn->bufsize] = 0;
- DEBUGMSGTL(("vcli_mib", "<<varnish: %s\n", conn->base));
+ DEBUGMSGTL(("varnish_mib:vcli", "<<varnish: %s\n", conn->base));
}
return ret;
@@ -229,7 +229,7 @@ vcli_write(struct vcli_conn *conn)
{
size_t size;
- DEBUGMSGTL(("vcli_mib", ">>varnish: %s\n", conn->base));
+ DEBUGMSGTL(("varnish_mib:vcli", ">>varnish: %s\n", conn->base));
for (size = 0; size < conn->bufsize; ) {
int n = write(conn->fd, conn->base + size,
conn->bufsize - size);
@@ -439,7 +439,7 @@ vcli_connect(struct VSM_data *vd, struct vcli_conn *conn)
snmp_log(LOG_ERR, "no -T arg in shared memory\n");
return SNMP_ERR_GENERR;
}
- DEBUGMSGTL(("vcli_mib", "-T '%s'\n", vt.b));
+ DEBUGMSGTL(("varnish_mib:vcli", "-T '%s'\n", vt.b));
s = strdup(vt.b);
if (!s) {
@@ -489,7 +489,7 @@ vcli_connect(struct VSM_data *vd, struct vcli_conn *conn)
snmp_log(LOG_ERR, "no -S arg in shared memory\n");
return SNMP_ERR_GENERR;
}
- DEBUGMSGTL(("vcli_mib", "-S '%s'\n", vt.b));
+ DEBUGMSGTL(("varnish_mib:vcli", "-S '%s'\n", vt.b));
s = strdup(vt.b);
if (!s) {
snmp_log(LOG_ERR, "out of memory\n");

Return to:

Send suggestions and report system problems to the System administrator.