Code

collectd-nagios: Select a single host in LISTVAL output when -H has been used.
authorSebastian Harl <sh@tokkee.org>
Mon, 16 May 2011 12:43:34 +0000 (14:43 +0200)
committerSebastian Harl <sh@tokkee.org>
Mon, 16 May 2011 12:43:34 +0000 (14:43 +0200)
src/collectd-nagios.c

index d3923f1fcab46b00c29ca6f46208839d21415b2f..d6e9868c3657488f6cc2080bf51673dc97e8f8ff 100644 (file)
@@ -288,6 +288,9 @@ static int do_listval (lcc_connection_t *connection)
        for (i = 0; i < ret_ident_num; ++i) {
                char id[1024];
 
+               if ((hostname_g != NULL) && (strcasecmp (hostname_g, ret_ident[i].host)))
+                       continue;
+
                status = lcc_identifier_to_string (connection,
                                id, sizeof (id), ret_ident + i);
                if (status != 0) {