summaryrefslogtreecommitdiff
path: root/cleopatre/application/spidnetsnmp/man/netsnmp_snmp_logging.3
blob: 2e200d34c8763a9319b13f30fb3c4f39cc1b1453 (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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
.TH "generic logging for net-snmp" 3 "5 Sep 2008" "Version 5.4.2" "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_CONS\fP   0"
.br
.ti -1c
.RI "#define \fBLOG_PID\fP   0"
.br
.ti -1c
.RI "#define \fBLOG_LOCAL0\fP   0"
.br
.ti -1c
.RI "#define \fBLOG_LOCAL1\fP   0"
.br
.ti -1c
.RI "#define \fBLOG_LOCAL2\fP   0"
.br
.ti -1c
.RI "#define \fBLOG_LOCAL3\fP   0"
.br
.ti -1c
.RI "#define \fBLOG_LOCAL4\fP   0"
.br
.ti -1c
.RI "#define \fBLOG_LOCAL5\fP   0"
.br
.ti -1c
.RI "#define \fBLOG_LOCAL6\fP   0"
.br
.ti -1c
.RI "#define \fBLOG_LOCAL7\fP   0"
.br
.ti -1c
.RI "#define \fBLOG_DAEMON\fP   0"
.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 variable 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 variable 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
Definition at line 616 of file snmp_logging.c.
.PP
References netsnmp_log_handler_s::enabled, logh_head, netsnmp_enable_filelog(), netsnmp_log_handler_s::next, snmp_disable_filelog_entry(), snmp_disable_syslog_entry(), snmp_enable_syslog_ident(), and netsnmp_log_handler_s::type.
.SS "int snmp_get_do_logging (void)"
.PP
Is logging done? 
.PP
\fBReturns:\fP
.RS 4
Returns 0 if logging is off, 1 when it is done. 
.RE
.PP

.PP
Definition at line 473 of file snmp_logging.c.
.PP
References netsnmp_log_handler_s::enabled, logh_head, and netsnmp_log_handler_s::next.
.PP
Referenced by netsnmp_agent_check_parse().
.SS "int snmp_log (int priority, const char * format,  ...)"
.PP
This snmp logging function allows variable argument list given the specified format and priority. 
.PP
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 1255 of file snmp_logging.c.
.PP
References snmp_vlog().
.PP
Referenced by _callback_lock(), _request_set_error(), _sess_read(), agent_check_and_process(), config_perror(), config_pwarn(), convert_v1pdu_to_v2(), convert_v2pdu_to_v1(), copy_word(), create_trap_session(), init_agent(), init_master_agent(), netsnmp_addrcache_add(), netsnmp_agent_check_packet(), netsnmp_agent_check_parse(), netsnmp_baby_steps_handler_get(), netsnmp_cache_create(), netsnmp_cache_helper_handler(), netsnmp_cache_timer_start(), netsnmp_cache_timer_stop(), netsnmp_call_handler(), netsnmp_call_handlers(), netsnmp_call_next_handler(), netsnmp_call_next_handler_one_request(), netsnmp_config_parse_add_row(), netsnmp_config_parse_table_set(), netsnmp_container_get_null(), netsnmp_container_iterator_get(), netsnmp_container_table_handler_get(), netsnmp_container_table_register(), netsnmp_data_list_add_data(), netsnmp_data_list_add_node(), netsnmp_ds_handle_config(), netsnmp_get_multiplexer_handler(), netsnmp_get_table_data_handler(), netsnmp_get_table_data_set_handler(), netsnmp_get_table_handler(), netsnmp_get_tdata_handler(), netsnmp_inject_handler_before(), netsnmp_instance_counter32_handler(), netsnmp_mark_row_column_writable(), netsnmp_multiplexer_helper_handler(), netsnmp_read_data_callback(), netsnmp_register_handler(), netsnmp_register_handler_nocallback(), netsnmp_register_mib(), netsnmp_register_num_file_instance(), netsnmp_register_save_list(), netsnmp_request_set_error_all(), netsnmp_row_merge_status_get(), netsnmp_save_all_data_callback(), netsnmp_send_traps(), netsnmp_sess_log_error(), netsnmp_set_row_column(), netsnmp_table_container_register(), netsnmp_table_data_add_row(), netsnmp_table_data_set_helper_handler(), netsnmp_table_iterator_helper_handler(), netsnmp_table_row_handler_get(), netsnmp_table_row_register(), netsnmp_table_set_add_default_row(), netsnmp_tdata_add_row(), netsnmp_wrap_up_request(), read_config_files(), read_config_print_usage(), read_config_read_octet_string(), read_config_store(), register_signal(), snmp_build(), snmp_clean_persistent(), snmp_log_perror(), snmp_pdu_parse(), snmp_perror(), snmp_save_persistent(), snmp_set_var_value(), snmpd_parse_config_authtrap(), snmpv3_make_report(), snmpv3_packet_build(), snmpv3_parse(), and table_helper_handler().
.SS "int snmp_vlog (int priority, const char * format, va_list ap)"
.PP
This snmp logging function allows variable argument list given the specified priority, format and a populated va_list structure. 
.PP
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 variable 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 1194 of file snmp_logging.c.
.PP
References LOGLENGTH, NULL, snmp_log_string(), va_copy, and vsnprintf().
.PP
Referenced by snmp_log().