summaryrefslogtreecommitdiff
path: root/man/netsnmp_snmp_logging.3
blob: 9c26645cee5615041fb16b7a29e83d14674f1198 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
.TH "generic logging for net-snmp" 3 "23 May 2010" "Version 5.4.3.pre1" "net-snmp" \" -*- nroff -*-
.ad l
.nh
.SH NAME
generic logging for net-snmp \- 
.SS "Defines"

.in +1c
.ti -1c
.RI "#define \fBLOGLENGTH\fP   1024"
.br
.ti -1c
.RI "#define \fBva_copy\fP(dest, src)   memcpy (&dest, &src, sizeof (va_list))"
.br
.ti -1c
.RI "#define \fBLOG_USER\fP   0"
.br
.in -1c
.SS "Functions"

.in +1c
.ti -1c
.RI "void \fBnetsnmp_enable_filelog\fP (\fBnetsnmp_log_handler\fP *logh, int dont_zero_log)"
.br
.ti -1c
.RI "int \fBvsnprintf\fP (char *str, size_t count, const char *fmt, va_list arg)"
.br
.ti -1c
.RI "void \fBinit_snmp_logging\fP (void)"
.br
.ti -1c
.RI "void \fBshutdown_snmp_logging\fP (void)"
.br
.ti -1c
.RI "int \fBdecode_priority\fP (char **optarg, int *pri_max)"
.br
.ti -1c
.RI "int \fBdecode_facility\fP (char *optarg)"
.br
.ti -1c
.RI "int \fBsnmp_log_options\fP (char *optarg, int argc, char *const *argv)"
.br
.ti -1c
.RI "char * \fBsnmp_log_syslogname\fP (const char *pstr)"
.br
.ti -1c
.RI "void \fBsnmp_log_options_usage\fP (const char *lead, FILE *outf)"
.br
.ti -1c
.RI "int \fBsnmp_get_do_logging\fP (void)"
.br
.RI "\fIIs logging done? \fP"
.ti -1c
.RI "void \fBsnmp_disable_syslog_entry\fP (\fBnetsnmp_log_handler\fP *logh)"
.br
.ti -1c
.RI "void \fBsnmp_disable_syslog\fP (void)"
.br
.ti -1c
.RI "void \fBsnmp_disable_filelog_entry\fP (\fBnetsnmp_log_handler\fP *logh)"
.br
.ti -1c
.RI "void \fBsnmp_disable_filelog\fP (void)"
.br
.ti -1c
.RI "int \fBsnmp_stderrlog_status\fP (void)"
.br
.ti -1c
.RI "void \fBsnmp_disable_stderrlog\fP (void)"
.br
.ti -1c
.RI "void \fBsnmp_disable_calllog\fP (void)"
.br
.ti -1c
.RI "void \fBsnmp_disable_log\fP (void)"
.br
.ti -1c
.RI "void \fBnetsnmp_logging_restart\fP (void)"
.br
.ti -1c
.RI "void \fBsnmp_enable_syslog\fP (void)"
.br
.ti -1c
.RI "void \fBsnmp_enable_syslog_ident\fP (const char *ident, const int facility)"
.br
.ti -1c
.RI "void \fBsnmp_enable_filelog\fP (const char *logfilename, int dont_zero_log)"
.br
.ti -1c
.RI "void \fBsnmp_enable_stderrlog\fP (void)"
.br
.ti -1c
.RI "void \fBsnmp_enable_calllog\fP (void)"
.br
.ti -1c
.RI "\fBnetsnmp_log_handler\fP * \fBnetsnmp_find_loghandler\fP (const char *token)"
.br
.ti -1c
.RI "int \fBnetsnmp_add_loghandler\fP (\fBnetsnmp_log_handler\fP *logh)"
.br
.ti -1c
.RI "\fBnetsnmp_log_handler\fP * \fBnetsnmp_register_loghandler\fP (int type, int priority)"
.br
.ti -1c
.RI "int \fBnetsnmp_enable_loghandler\fP (const char *token)"
.br
.ti -1c
.RI "int \fBnetsnmp_disable_loghandler\fP (const char *token)"
.br
.ti -1c
.RI "int \fBnetsnmp_remove_loghandler\fP (\fBnetsnmp_log_handler\fP *logh)"
.br
.ti -1c
.RI "int \fBlog_handler_stdouterr\fP (\fBnetsnmp_log_handler\fP *logh, int pri, const char *str)"
.br
.ti -1c
.RI "int \fBlog_handler_syslog\fP (\fBnetsnmp_log_handler\fP *logh, int pri, const char *str)"
.br
.ti -1c
.RI "int \fBlog_handler_file\fP (\fBnetsnmp_log_handler\fP *logh, int pri, const char *str)"
.br
.ti -1c
.RI "int \fBlog_handler_callback\fP (\fBnetsnmp_log_handler\fP *logh, int pri, const char *str)"
.br
.ti -1c
.RI "int \fBlog_handler_null\fP (\fBnetsnmp_log_handler\fP *logh, int pri, const char *str)"
.br
.ti -1c
.RI "void \fBsnmp_log_string\fP (int priority, const char *str)"
.br
.ti -1c
.RI "int \fBsnmp_vlog\fP (int priority, const char *format, va_list ap)"
.br
.RI "\fIThis snmp logging function allows \fBvariable\fP argument list given the specified priority, format and a populated va_list structure. \fP"
.ti -1c
.RI "int \fBsnmp_log\fP (int priority, const char *format,...)"
.br
.RI "\fIThis snmp logging function allows \fBvariable\fP argument list given the specified format and priority. \fP"
.ti -1c
.RI "void \fBsnmp_log_perror\fP (const char *s)"
.br
.ti -1c
.RI "\fBnetsnmp_log_handler\fP * \fBget_logh_head\fP (void)"
.br
.in -1c
.SS "Variables"

.in +1c
.ti -1c
.RI "\fBnetsnmp_log_handler\fP * \fBlogh_head\fP = NULL"
.br
.ti -1c
.RI "\fBnetsnmp_log_handler\fP * \fBlogh_priorities\fP [LOG_DEBUG+1]"
.br
.in -1c
.SH "Function Documentation"
.PP 
.SS "void netsnmp_logging_restart (void)"
.PP
hmm, don't zero status isn't saved.. i think it's safer not to overwrite, in case a hup is just to re-read config files...
.PP
Definition at line 636 of file snmp_logging.c.
.SS "int snmp_get_do_logging (void)"
.PP
Is logging done? \fBReturns:\fP
.RS 4
Returns 0 if logging is off, 1 when it is done. 
.RE
.PP

.PP
Definition at line 493 of file snmp_logging.c.
.SS "int snmp_log (int priority, const char * format,  ...)"
.PP
This snmp logging function allows \fBvariable\fP argument list given the specified format and priority. Calls the snmp_vlog function. The default logfile this function writes to is /var/log/snmpd.log.
.PP
\fBSee also:\fP
.RS 4
\fBsnmp_vlog\fP 
.RE
.PP

.PP
\fBExamples: \fP
.in +1c
\fBdelayed_instance.c\fP.
.PP
Definition at line 1275 of file snmp_logging.c.
.SS "int snmp_vlog (int priority, const char * format, va_list ap)"
.PP
This snmp logging function allows \fBvariable\fP argument list given the specified priority, format and a populated va_list structure. The default logfile this function writes to is /var/log/snmpd.log.
.PP
\fBParameters:\fP
.RS 4
\fIpriority\fP is an integer representing the type of message to be written to the snmp log file. The types are errors, warning, and information.
.IP "\(bu" 2
The error types are:
.IP "  \(bu" 4
LOG_EMERG system is unusable
.IP "  \(bu" 4
LOG_ALERT action must be taken immediately
.IP "  \(bu" 4
LOG_CRIT critical conditions
.IP "  \(bu" 4
LOG_ERR error conditions
.PP

.IP "\(bu" 2
The warning type is:
.IP "  \(bu" 4
LOG_WARNING warning conditions
.PP

.IP "\(bu" 2
The information types are:
.IP "  \(bu" 4
LOG_NOTICE normal but significant condition
.IP "  \(bu" 4
LOG_INFO informational
.IP "  \(bu" 4
LOG_DEBUG debug-level messages
.PP

.PP
.br
\fIformat\fP is a pointer to a char representing the \fBvariable\fP argument list format used.
.br
\fIap\fP is a va_list type used to traverse the list of arguments.
.RE
.PP
\fBReturns:\fP
.RS 4
Returns 0 on success, -1 when the code could not format the log- string, -2 when dynamic memory could not be allocated if the length of the log buffer is greater then 1024 bytes. For each of these errors a LOG_ERR messgae is written to the logfile.
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsnmp_log\fP 
.RE
.PP

.PP
Definition at line 1214 of file snmp_logging.c.
.SH "Author"
.PP 
Generated automatically by Doxygen for net-snmp from the source code.