update cnagios to 0.29, from Simon Kuhnle (taking maintainer).
This commit is contained in:
parent
ee7bd8eebc
commit
55f6dca80b
@ -1,13 +1,14 @@
|
||||
# $OpenBSD: Makefile,v 1.13 2011/03/04 14:08:58 sthen Exp $
|
||||
# $OpenBSD: Makefile,v 1.14 2011/03/28 08:37:45 sthen Exp $
|
||||
|
||||
COMMENT = console interface for nagios
|
||||
|
||||
DISTNAME = cnagios-0.27
|
||||
REVISION = 1
|
||||
DISTNAME = cnagios-0.29
|
||||
CATEGORIES = net
|
||||
|
||||
HOMEPAGE = http://noc.hep.wisc.edu/cnagios.txt
|
||||
|
||||
MAINTAINER= Simon Kuhnle <simon@blarzwurst.de>
|
||||
|
||||
WANTLIB = c perl util curses m
|
||||
|
||||
# ISC
|
||||
|
@ -1,5 +1,5 @@
|
||||
MD5 (cnagios-0.27.tar.gz) = yfuaDJrWxDrdM6QKPXJzqA==
|
||||
RMD160 (cnagios-0.27.tar.gz) = ddm/1nzQ4Q/71/Q4gmo40Nfau1Y=
|
||||
SHA1 (cnagios-0.27.tar.gz) = 1AUnrTPcNoOMV2I4jzq/9HYJB0M=
|
||||
SHA256 (cnagios-0.27.tar.gz) = UyUjnXLbUV+jSb12AxVT1hy6KiIvuqGsCHwgpvvLwR4=
|
||||
SIZE (cnagios-0.27.tar.gz) = 75321
|
||||
MD5 (cnagios-0.29.tar.gz) = 8YLLzC9buu5hgVwZnrQuJg==
|
||||
RMD160 (cnagios-0.29.tar.gz) = RbwAkqSjfc1tOckOFmNsAZwZuX4=
|
||||
SHA1 (cnagios-0.29.tar.gz) = lvHA3Z06Td1v/pBJRI7kZMgLr1g=
|
||||
SHA256 (cnagios-0.29.tar.gz) = ZipSYp95wSdW29gA9lpcbOBIKhfu2QyWH1Nml9iHWpM=
|
||||
SIZE (cnagios-0.29.tar.gz) = 81276
|
||||
|
@ -1,19 +0,0 @@
|
||||
$OpenBSD: patch-cmds_c,v 1.1 2009/10/01 14:09:55 sthen Exp $
|
||||
--- cmds.c.orig Sat Apr 12 16:21:29 2008
|
||||
+++ cmds.c Thu Oct 1 13:48:42 2009
|
||||
@@ -7,6 +7,7 @@
|
||||
/*------------------------------------------------------------------*/
|
||||
|
||||
#include <string.h>
|
||||
+#include <unistd.h>
|
||||
#include "cnagios.h"
|
||||
#include <curses.h>
|
||||
|
||||
@@ -35,6 +36,7 @@ extern char fkey_not_name_filters[13][STRING_LENGTH];
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
|
||||
+void
|
||||
getch_loop()
|
||||
{
|
||||
int ch, secs, page_up, page_down, i;
|
@ -1,38 +0,0 @@
|
||||
$OpenBSD: patch-cnagios_c,v 1.1 2009/10/01 14:09:55 sthen Exp $
|
||||
--- cnagios.c.orig Sat Apr 12 16:21:29 2008
|
||||
+++ cnagios.c Thu Oct 1 13:43:46 2009
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <signal.h>
|
||||
#include <sys/param.h>
|
||||
#include <getopt.h>
|
||||
+#include <unistd.h>
|
||||
#include "cnagios.h"
|
||||
#include "version.h"
|
||||
|
||||
@@ -37,8 +38,11 @@ extern int age_filter_secs;
|
||||
extern int age_okay_filter_secs;
|
||||
extern int need_swipe;
|
||||
|
||||
+void usage();
|
||||
+
|
||||
/*------------------------------------------------------------------*/
|
||||
|
||||
+int
|
||||
main(argc,argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
@@ -253,12 +257,13 @@ debug("");
|
||||
/* destroy perl... */
|
||||
|
||||
perl_hook_free();
|
||||
+ return(0);
|
||||
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
|
||||
-usage()
|
||||
+void usage()
|
||||
{
|
||||
printf("usage: cnagios [options]\n");
|
||||
printf(" -A <age> filter UP/OKAY objects by age less than <age>\n");
|
@ -1,25 +0,0 @@
|
||||
$OpenBSD: patch-cnagios_h_in,v 1.1 2009/10/01 14:09:55 sthen Exp $
|
||||
--- cnagios.h.in.orig Sat Apr 12 16:21:29 2008
|
||||
+++ cnagios.h.in Thu Oct 1 14:46:17 2009
|
||||
@@ -135,3 +135,21 @@ struct seen_item {
|
||||
struct seen_item *next;
|
||||
};
|
||||
|
||||
+void add_seen_item(int);
|
||||
+char *calc_duration();
|
||||
+int convert_level(char *);
|
||||
+void draw_screen();
|
||||
+int filter_doesnt_match(char *, char *);
|
||||
+int filter_matches(char *, char *);
|
||||
+void getch_loop();
|
||||
+void help();
|
||||
+int parse_age_filter(char *,int);
|
||||
+void perl_hook(int, char *);
|
||||
+void perl_hook_init();
|
||||
+void perl_hook_free();
|
||||
+int perl_regex_hook(char *,char *,int);
|
||||
+void read_dot_files();
|
||||
+void read_status();
|
||||
+void read_v1_status();
|
||||
+void read_v23_status();
|
||||
+
|
@ -1,11 +0,0 @@
|
||||
$OpenBSD: patch-debug_c,v 1.1 2009/10/01 14:09:55 sthen Exp $
|
||||
--- debug.c.orig Thu Oct 1 14:38:24 2009
|
||||
+++ debug.c Thu Oct 1 14:38:28 2009
|
||||
@@ -9,6 +9,7 @@ extern int debugging;
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
|
||||
+void
|
||||
debug(msg,a,b,c,d,e,f,g,h,i,j,k)
|
||||
char *msg;
|
||||
{
|
@ -1,28 +0,0 @@
|
||||
$OpenBSD: patch-dotfile_c,v 1.1 2009/10/01 14:09:55 sthen Exp $
|
||||
--- dotfile.c.orig Sat Apr 12 16:21:29 2008
|
||||
+++ dotfile.c Thu Oct 1 14:43:44 2009
|
||||
@@ -33,8 +33,11 @@ extern int host_level;
|
||||
#define _DEBUG_DOTFILE_
|
||||
#endif
|
||||
|
||||
+void read_dot_file(char *);
|
||||
+
|
||||
/*------------------------------------------------------------------*/
|
||||
|
||||
+void
|
||||
read_dot_files()
|
||||
{
|
||||
int i;
|
||||
@@ -54,10 +57,11 @@ read_dot_files()
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
|
||||
+void
|
||||
read_dot_file(filename)
|
||||
char *filename;
|
||||
{
|
||||
- char *str_match, *tok1, *tok2, *tok3, *tok4;
|
||||
+ char *tok1, *tok2, *tok3, *tok4;
|
||||
FILE *fp;
|
||||
char buf[MAX_CHARS_PER_LINE];
|
||||
int l, fkey_num;
|
@ -1,62 +0,0 @@
|
||||
$OpenBSD: patch-draw_c,v 1.2 2011/03/04 14:08:58 sthen Exp $
|
||||
--- draw.c.orig Sat Oct 16 15:47:56 2010
|
||||
+++ draw.c Fri Mar 4 14:50:09 2011
|
||||
@@ -5,8 +5,10 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
#include <curses.h>
|
||||
#include <string.h>
|
||||
+#include <unistd.h>
|
||||
#include "cnagios.h"
|
||||
#include "version.h"
|
||||
|
||||
@@ -49,20 +51,18 @@ extern int age_okay_filter_secs;
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
+void
|
||||
draw_screen()
|
||||
{
|
||||
int i, j;
|
||||
int screen_line = 0;
|
||||
char buf[MAX_TERM_WIDTH];
|
||||
char buf2[MAX_TERM_WIDTH];
|
||||
- FILE *fp;
|
||||
struct obj_by_age *age_ptr;
|
||||
struct seen_item *tmp, *prev;
|
||||
int items_matched = 0, page_size, begin_item;
|
||||
int total_items_matched = 0;
|
||||
- int match_list[MAX_ITEMS];
|
||||
int descr_width = 0;
|
||||
- char *duration;
|
||||
int duration_int;
|
||||
int num_filters = 0;
|
||||
|
||||
@@ -221,7 +221,7 @@ draw_screen()
|
||||
}
|
||||
if ( sort_mode == SORT_BY_AGE ) {
|
||||
age_ptr = hosts_by_age;
|
||||
- while ( age_ptr->next != NULL ) {
|
||||
+ while ( age_ptr != NULL ) {
|
||||
if ( age_ptr->level >= host_level ) {
|
||||
add_seen_item(age_ptr->index);
|
||||
}
|
||||
@@ -240,7 +240,7 @@ draw_screen()
|
||||
}
|
||||
if ( sort_mode == SORT_BY_AGE ) {
|
||||
age_ptr = services_by_age;
|
||||
- while ( age_ptr->next != NULL ) {
|
||||
+ while ( age_ptr != NULL ) {
|
||||
if ( age_ptr->level >= service_level ) {
|
||||
add_seen_item(age_ptr->index);
|
||||
}
|
||||
@@ -501,6 +501,7 @@ char *filter, *str;
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
+void
|
||||
add_seen_item(idx)
|
||||
int idx;
|
||||
{
|
@ -1,18 +0,0 @@
|
||||
$OpenBSD: patch-help_c,v 1.1 2009/10/01 14:09:55 sthen Exp $
|
||||
--- help.c.orig Sat Apr 12 16:21:29 2008
|
||||
+++ help.c Thu Oct 1 14:39:58 2009
|
||||
@@ -4,12 +4,14 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
+#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <curses.h>
|
||||
#include "cnagios.h"
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
|
||||
+void
|
||||
help()
|
||||
{
|
||||
FILE *fp;
|
@ -1,35 +0,0 @@
|
||||
$OpenBSD: patch-perl_c,v 1.1 2009/10/01 14:09:55 sthen Exp $
|
||||
--- perl.c.orig Thu Oct 1 13:51:39 2009
|
||||
+++ perl.c Thu Oct 1 13:52:26 2009
|
||||
@@ -16,6 +16,7 @@ int sub_file_line;
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
|
||||
+void
|
||||
perl_hook_init() {
|
||||
char *embedded_perl_file[] = {"",PERL_HOOK_FILE};
|
||||
char junk[MAX_CHARS_PER_LINE];
|
||||
@@ -43,6 +44,7 @@ perl_hook_init() {
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
|
||||
+void
|
||||
perl_hook_free() {
|
||||
PL_perl_destruct_level = 0;
|
||||
perl_destruct(my_perl);
|
||||
@@ -51,6 +53,7 @@ perl_hook_free() {
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
|
||||
+void
|
||||
perl_hook(type,str)
|
||||
int type;
|
||||
char *str;
|
||||
@@ -84,6 +87,7 @@ char *str;
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
|
||||
+int
|
||||
perl_regex_hook(str,regex,mode)
|
||||
char *str;
|
||||
char *regex;
|
@ -1,27 +0,0 @@
|
||||
$OpenBSD: patch-read_c,v 1.1 2009/10/01 14:09:55 sthen Exp $
|
||||
--- read.c.orig Sat Apr 12 16:21:29 2008
|
||||
+++ read.c Thu Oct 1 14:46:05 2009
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
+#include <unistd.h>
|
||||
#include <curses.h>
|
||||
#include "cnagios.h"
|
||||
|
||||
@@ -24,7 +25,6 @@ int num_up, num_down;
|
||||
int num_okay, num_warn, num_crit;
|
||||
char last_update[21];
|
||||
int last_update_int;
|
||||
-char *calc_duration();
|
||||
|
||||
extern int object_mode;
|
||||
extern int sort_mode;
|
||||
@@ -33,6 +33,7 @@ extern int color;
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
|
||||
+void
|
||||
read_status()
|
||||
{
|
||||
int i, j;
|
@ -1,34 +1,13 @@
|
||||
$OpenBSD: patch-readv1_c,v 1.2 2011/03/04 11:21:45 sthen Exp $
|
||||
--- readv1.c.orig Sat Oct 16 15:47:56 2010
|
||||
+++ readv1.c Fri Mar 4 12:08:21 2011
|
||||
@@ -32,10 +32,11 @@ extern int color;
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
|
||||
+void
|
||||
read_v1_status()
|
||||
$OpenBSD: patch-readv1_c,v 1.3 2011/03/28 08:37:45 sthen Exp $
|
||||
--- readv1.c.orig Mon Mar 28 10:09:47 2011
|
||||
+++ readv1.c Mon Mar 28 10:09:55 2011
|
||||
@@ -37,8 +37,7 @@ read_v1_status()
|
||||
{
|
||||
FILE *fp;
|
||||
- int i, j, k;
|
||||
+ int i, k;
|
||||
int line_num, stamp;
|
||||
int i, k;
|
||||
- int line_num;
|
||||
- long stamp;
|
||||
+ int line_num, stamp;
|
||||
char buffer[MAX_CHARS_PER_LINE];
|
||||
char *str_match;
|
||||
@@ -124,7 +125,7 @@ debug("status file is %s",STATUS_FILE);
|
||||
strncpy(host_list[host_list_size][LAST_STATE_CHANGE]," not applicable ",strlen(str_match)+1);
|
||||
host_list[host_list_size][DURATION] = (char *)calc_duration(stamp);
|
||||
} else {
|
||||
- sscanf(str_match,"%ld",&stamp);
|
||||
+ sscanf(str_match,"%d",&stamp);
|
||||
host_list[host_list_size][LAST_STATE_CHANGE_INT] = (char *)stamp;
|
||||
host_list[host_list_size][LAST_STATE_CHANGE] = malloc(17); /* "DOW Mon DD HH:MM\0" */
|
||||
strncpy(host_list[host_list_size][LAST_STATE_CHANGE],ctime((time_t *)&stamp),16);
|
||||
@@ -195,7 +196,7 @@ debug("status file is %s",STATUS_FILE);
|
||||
service_list[service_list_size][DURATION] = malloc(1);
|
||||
service_list[service_list_size][DURATION] = (char *)calc_duration(stamp);
|
||||
} else {
|
||||
- sscanf(str_match,"%ld",&stamp);
|
||||
+ sscanf(str_match,"%d",&stamp);
|
||||
service_list[service_list_size][LAST_STATE_CHANGE_INT] = (char *)stamp;
|
||||
strncpy(service_list[service_list_size][LAST_STATE_CHANGE],ctime((time_t *)&stamp),16);
|
||||
service_list[service_list_size][DURATION] = (char *)calc_duration(stamp);
|
||||
char entry_type[MAX_STATUS_TYPE_LEN];
|
||||
|
@ -1,41 +1,13 @@
|
||||
$OpenBSD: patch-readv23_c,v 1.3 2011/03/04 11:21:45 sthen Exp $
|
||||
--- readv23.c.orig Sat Oct 16 15:47:56 2010
|
||||
+++ readv23.c Fri Mar 4 12:14:16 2011
|
||||
@@ -37,8 +37,11 @@ struct status_dot_dat_entry {
|
||||
char *rhs;
|
||||
};
|
||||
|
||||
+void parse_entry(struct status_dot_dat_entry *, char *);
|
||||
+
|
||||
/*------------------------------------------------------------------*/
|
||||
|
||||
+void
|
||||
read_v23_status()
|
||||
{
|
||||
$OpenBSD: patch-readv23_c,v 1.4 2011/03/28 08:37:45 sthen Exp $
|
||||
--- readv23.c.orig Mon Mar 28 10:10:02 2011
|
||||
+++ readv23.c Mon Mar 28 10:10:12 2011
|
||||
@@ -47,8 +47,7 @@ read_v23_status()
|
||||
FILE *fp;
|
||||
@@ -157,7 +160,7 @@ debug(" plugin_output (post-munge) is %s",host_list[h
|
||||
for (i=0; i < 11; i++) { fgets(buffer,sizeof(buffer),fp); }
|
||||
}
|
||||
parse_entry(&ent,buffer);
|
||||
- sscanf(ent.rhs,"%ld",&stamp);
|
||||
+ sscanf(ent.rhs,"%d",&stamp);
|
||||
char buffer[MAX_CHARS_PER_LINE];
|
||||
struct status_dot_dat_entry ent;
|
||||
- int i;
|
||||
- long stamp;
|
||||
+ int i, stamp;
|
||||
|
||||
if ( (stamp == 0) && (host_list[host_list_size][PLUGIN_OUTPUT][0] == '\0') ) {
|
||||
/* PENDING... is really UP with NULL plugin output on Jan 1 1970... */
|
||||
@@ -277,7 +280,7 @@ debug(" OUT current_state is %s",service_list[service
|
||||
for (i=0; i < 11; i++) { fgets(buffer,sizeof(buffer),fp); }
|
||||
}
|
||||
parse_entry(&ent,buffer);
|
||||
- sscanf(ent.rhs,"%ld",&stamp);
|
||||
+ sscanf(ent.rhs,"%d",&stamp);
|
||||
service_list[service_list_size][LAST_STATE_CHANGE_INT] = (char *)stamp;
|
||||
service_list[service_list_size][LAST_STATE_CHANGE] = malloc(17); /* "DOW Mon DD HH:MM\0" */
|
||||
strncpy(service_list[service_list_size][LAST_STATE_CHANGE],ctime((time_t *)&stamp),16);
|
||||
@@ -375,6 +378,7 @@ debug(" OUT plugin_output after munge is %s",service_
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
+void
|
||||
parse_entry(ent,str)
|
||||
struct status_dot_dat_entry *ent;
|
||||
char *str;
|
||||
#ifdef _DEBUG_
|
||||
debug("read_v23_status()...");
|
||||
|
@ -1,11 +0,0 @@
|
||||
$OpenBSD: patch-update_c,v 1.1 2009/10/01 14:09:55 sthen Exp $
|
||||
--- update.c.orig Thu Oct 1 13:18:59 2009
|
||||
+++ update.c Thu Oct 1 13:19:05 2009
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "cnagios.h"
|
||||
#include <signal.h>
|
||||
+#include <unistd.h>
|
||||
|
||||
extern int need_swipe;
|
||||
extern int polling_interval;
|
Loading…
Reference in New Issue
Block a user