Monitoring and logging это то, к чему прибегают для решения проблем.
Параметры Monitoring and logging задаются в файле
/etc/asterisk/logger.conf
[general] [logfiles] console => notice,warning,error,dtmf messages => notice,warning,error ;verbose => notice,warning,error,verbose
При такой конфигурации логи будут валиться в файлы:
/var/log/asterisk/messages
/var/log/asterisk/verbose
Также логи будут валиться в консоль (asterisk -r), если её открыть.
Для применения изменений в файле logger.conf:
asterisk -rx 'logger reload'
*CLI> logger reload
CLI> logger show channels
Type | Description |
notice | You will see a lot of these during a reload, but they will also happen during normal call flow. A notice is simply any event that Asterisk wishes to inform you of. |
warning | A warning represents a problem that could be severe enough to affect a call (including disconnecting a call because call flow cannot continue). Warnings need to be addressed. |
error | Errors represent significant problems in the system that must be addressed immediately. |
debug | Debugging is only useful if you are troubleshooting a problem with the Asterisk code itself. You would not use debug to troubleshoot your dialplan, but you would use it if the Asterisk developers asked you to provide logs for a problem you were reporting. Do not use debug in production, as the amount of detail stored can fill up a hard drive in a matter of days |
verbose | This is one of the most useful of the logging types, but it is also one of the more risky to leave unattended, due to the possibility of the output filling your hard drive |
dtmf | Logging DTMF can be helpful if you are getting complaints that calls are not routing from the auto attendant correctly. |
fax | This type of logging causes fax-related messages from the fax technology backend (res_fax_spandsp or res_fax_digium) to be logged to the fax logger. |
* | This will log EVERYTHING (and we mean everything). Do not use this unless you understand the implications of storing this amount of data. It will not end well |
Во избежание переполнения диска, при нормальной работе рекомендуется следующий файл logger.conf:
[general] [logfiles] console => notice,warning,error,dtmf messages => notice,warning,error ;verbose => notice,warning,error,verbose
Для дебага из консоли или из файла мы добавим оператор debug:
[general] [logfiles] console => debug,notice,warning,error,dtmf messages => debug,notice,warning,error ;verbose => notice,warning,error,verbose
Для просмотра verbose из консоли нужно дать команду:
*CLI> core set verbose 10
В Asterisk 11 каждая строка дебага ассоциированная с данным звонком включает в себя call ID.
Поэтому для анализа нужно дать команду типа:
cat /var/log/asterisk/messages | grep C-00000005
[Sep 8 10:45:07] DEBUG[1119][C-00000005] chan_sip.c: Acked pending invite 102 [Sep 8 10:45:07] DEBUG[1119][C-00000005] chan_sip.c: Stopping retransmission on '0c9aa5b3734047910a5f08f46e58423e@192.168.10.114:5060' of Request 102: Match Found [Sep 8 10:45:07] DEBUG[1119][C-00000005] res_rtp_asterisk.c: Setting RTCP address on RTP instance '0x1c999e8' [Sep 8 10:45:07] DEBUG[1119][C-00000005] netsock2.c: Splitting '192.168.2.12:61037' into... [Sep 8 10:45:07] DEBUG[1119][C-00000005] netsock2.c: ...host '192.168.2.12' and port '61037'. [Sep 8 10:45:07] DEBUG[1119][C-00000005] chan_sip.c: Trying to put 'ACK sip:6C6' onto UDP socket destined for 192.168.2.12:61037 [Sep 8 10:45:07] DEBUG[1119][C-00000005] chan_sip.c: Setting SIP_ALREADYGONE on dialog 0c9aa5b3734047910a5f08f46e58423e@192.168.10.114:5060 [Sep 8 10:45:07] DEBUG[1361][C-00000005] channel.c: Hanging up channel 'SIP/6C626D04E1EB-00000009' [Sep 8 10:45:07] DEBUG[1361][C-00000005] chan_sip.c: Hangup call SIP/6C626D04E1EB-00000009, SIP callid 0c9aa5b3734047910a5f08f46e58423e@192.168.10.114:5060 [Sep 8 10:45:07] DEBUG[1361][C-00000005] res_rtp_asterisk.c: Setting RTCP address on RTP instance '0x1c999e8' [Sep 8 10:45:07] DEBUG[1361][C-00000005] app_dial.c: Exiting with DIALSTATUS=BUSY. [Sep 8 10:45:07] DEBUG[1361][C-00000005] channel.c: Driver for channel 'SIP/cucm01-00000008' does not support indication 5, emulating it [Sep 8 10:45:07] DEBUG[1361][C-00000005] channel.c: Set channel SIP/cucm01-00000008 to write format ulaw [Sep 8 10:45:07] DEBUG[1361][C-00000005] channel.c: Set channel SIP/cucm01-00000008 to write format slin [Sep 8 10:45:07] DEBUG[1361][C-00000005] channel.c: Scheduling timer at (50 requested / 50 actual) timer ticks per second [Sep 8 10:45:15] DEBUG[1119][C-00000005] chan_sip.c: **** Received BYE (8) - Command in SIP BYE [Sep 8 10:45:15] DEBUG[1119][C-00000005] netsock2.c: Splitting '192.168.0.11:5060' into... [Sep 8 10:45:15] DEBUG[1119][C-00000005] netsock2.c: ...host '192.168.0.11' and port '5060'. [Sep 8 10:45:15] DEBUG[1119][C-00000005] chan_sip.c: Setting SIP_ALREADYGONE on dialog dee8ce80-5ee1929a-160ac-b00a8c0@192.168.0.11 [Sep 8 10:45:15] DEBUG[1119][C-00000005] res_rtp_asterisk.c: Setting RTCP address on RTP instance '0x7ff29c013748' [Sep 8 10:45:15] DEBUG[1119][C-00000005] chan_sip.c: Session timer stopped: 138 - dee8ce80-5ee1929a-160ac-b00a8c0@192.168.0.11 [Sep 8 10:45:15] DEBUG[1119][C-00000005] chan_sip.c: Received bye, issuing owner hangup [Sep 8 10:45:15] DEBUG[1119][C-00000005] chan_sip.c: Trying to put 'SIP/2.0 200' onto UDP socket destined for 192.168.0.11:5060 [Sep 8 10:45:15] DEBUG[1361][C-00000005] channel.c: Set channel SIP/cucm01-00000008 to write format ulaw
использовалась статья
http://mannix.ru/prilozhenia/ustanovka-i-nastrojka-snmp-na-linux-debianu...
Добавить комментарий