| .TH "generic logging for net-snmp" 3 "24 Jun 2011" "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 639 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 496 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 1278 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 1217 of file snmp_logging.c. |
| .SH "Author" |
| .PP |
| Generated automatically by Doxygen for net-snmp from the source code. |