File tree Expand file tree Collapse file tree 8 files changed +150
-5109
lines changed Expand file tree Collapse file tree 8 files changed +150
-5109
lines changed Original file line number Diff line number Diff line change
1
+ # Ignore all
2
+ *
3
+ . *
4
+
5
+ # Except what we need to build
6
+ ! /configure
7
+ ! /configure.ac
8
+ ! /install-sh
9
+ ! /Makefile.in
10
+ ! /snmp_bulkget.c
11
+ ! /snmp_bulkget.h
12
+ ! /utils.c
13
+ ! /utils.h
Original file line number Diff line number Diff line change
1
+ # Hidden files
2
+ . *
3
+
4
+ # Prerequisites
5
+ * .d
6
+
7
+ # Object files
8
+ * .o
9
+ * .ko
10
+ * .obj
11
+ * .elf
12
+
13
+ # Linker output
14
+ * .ilk
15
+ * .map
16
+ * .exp
17
+
18
+ # Precompiled Headers
19
+ * .gch
20
+ * .pch
21
+
22
+ # Libraries
23
+ * .lib
24
+ * .a
25
+ * .la
26
+ * .lo
27
+
28
+ # Shared objects (inc. Windows DLLs)
29
+ * .dll
30
+ * .so
31
+ * .so. *
32
+ * .dylib
33
+
34
+ # Executables
35
+ * .exe
36
+ * .out
37
+ * .app
38
+ * .i * 86
39
+ * .x86_64
40
+ * .hex
41
+
42
+ # Debug files
43
+ * .dSYM /
44
+ * .su
45
+ * .idb
46
+ * .pdb
47
+
48
+ # http://www.gnu.org/software/autoconf
49
+ autom4te.cache
50
+ /autoscan.log
51
+ /autoscan- * .log
52
+ /aclocal.m4
53
+ /compile
54
+ /config.guess
55
+ /config.h.in
56
+ /config.log
57
+ /config.status
58
+ /config.sub
59
+ /configure
60
+ /configure.scan
61
+ /depcomp
62
+ /install-sh
63
+ /missing
64
+ /stamp-h1
65
+
66
+ # https://www.gnu.org/software/libtool/
67
+ /ltmain.sh
68
+
69
+ # http://www.gnu.org/software/texinfo
70
+ /texinfo.tex
71
+
72
+ # http://www.gnu.org/software/m4/
73
+ m4 /libtool.m4
74
+ m4 /ltoptions.m4
75
+ m4 /ltsugar.m4
76
+ m4 /ltversion.m4
77
+ m4 /lt~obsolete.m4
78
+
79
+ # http://www.gnu.org/software/make/
80
+ /Makefile
Original file line number Diff line number Diff line change
1
+ FROM debian:stable-slim as builder
2
+ WORKDIR /src
3
+ ENV LANG="C.UTF-8"
4
+ ENV TERM=xterm
5
+ ARG target=""
6
+ ONBUILD ENV DEBIAN_FRONTEND=noninteractive
7
+ RUN apt-get update \
8
+ && apt-get install -y \
9
+ build-essential \
10
+ libsnmp-dev \
11
+ && rm -rf /var/lib/apt/lists/*
12
+ COPY . .
13
+ RUN ./configure --libexecdir=/src \
14
+ && make $target
15
+
16
+ FROM debian:stable-slim
17
+ ONBUILD ENV DEBIAN_FRONTEND=noninteractive
18
+ RUN apt-get update \
19
+ && apt-get install -y \
20
+ libsnmp30 \
21
+ && rm -rf /var/lib/apt/lists/*
22
+ COPY --from=0 /src/check_interfaces /check_interfaces
23
+
24
+ ENTRYPOINT ["/check_interfaces" ]
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ CFLAGS=@CFLAGS@ @DEFS@
14
14
# DLFLAGS=-fPIC -shared
15
15
BUILDLIBS =@SNMP_LIBS@ @LIBS@
16
16
17
- .PHONY : debug clean all install
17
+ .PHONY : debug clean distclean all install
18
18
all : build strip
19
19
build : $(TARGET )
20
20
@@ -28,12 +28,11 @@ debug: CFLAGS += -DDEBUG -g -O0
28
28
debug : LDFLAGS += -g -O0
29
29
debug : build
30
30
31
-
32
31
clean :
33
- rm $(OBJS ) $(TARGET )
32
+ rm -f $(OBJS ) $(TARGET )
34
33
34
+ distclean : clean
35
+ rm -f config.log config.status Makefile
35
36
36
37
install : all
37
38
$(INSTALL ) -t $(DESTDIR ) $(TARGET )
38
-
39
-
Original file line number Diff line number Diff line change @@ -38,10 +38,10 @@ make install
38
38
(see also check_interface --help)
39
39
40
40
check_interface -c public -h 192.168.0.1 -r 'FastEth' -p '$SERVICEPERFDATA$' -t $LASTSERVICECHECK$ -a
41
-
41
+
42
42
Options;
43
43
-h address of device
44
-
44
+
45
45
-c|--community community (default public)
46
46
-r|--regex interface list regexp
47
47
Regex to match interfaces (important, this is a Regular Expression
@@ -122,3 +122,30 @@ Examples;
122
122
If unsure of a pattern, you should test it on the command line thus;
123
123
124
124
check_interface -c public -h 192.168.0.1 -r 'Eth(0|2)$'
125
+
126
+ ### Docker Build Environment
127
+
128
+ You can use docker for a development environment.
129
+
130
+ ** Usage:**
131
+
132
+ Simple use:
133
+
134
+ ``` sh
135
+ docker build -t check_interfaces .
136
+ docker run --rm check_interfaces -c public -h sw1
137
+ ```
138
+
139
+ Persistent container
140
+
141
+ ``` sh
142
+ docker build -t check_interfaces .
143
+ docker create --name=" check_sw1" check_interfaces -c public -h sw1
144
+ docker start -a check_sw1
145
+ ```
146
+
147
+ Create a debug build
148
+
149
+ ``` sh
150
+ docker build --build-arg target=debug -t check_interfaces .
151
+ ```
You can’t perform that action at this time.
0 commit comments