“Asterisk 日志文件 模块配置”的版本间的差异

来自最权威最新完整开源SIP,语音通信,融合通信中文技术文档资料,提供详细的Asterisk Freepbx, FreeSBC, 免费会话边界控制器,网关,语音板卡,IPPBX,SBC配置资料-asterisk,freepbx,freesbc 用户手册 界面配置,呼叫路由,IVR, 网关对接,拨号规则,SIP 分机呼叫,pjsip, IVR, 录音, CDR, 队列呼叫,振铃组,CLI 命令中文资料手册
跳转至: 导航搜索
(创建页面,内容为“Asterisk Logfiles The Asterisk Logfiles Module is an easy way to view portions of the Asterisk Log. However, this Module is only useful when you want to view a very...”)
 
 
(未显示同一用户的3个中间版本)
第1行: 第1行:
Asterisk Logfiles
+
'''Asterisk Logfiles''' <br/>
The Asterisk Logfiles Module is an easy way to view portions of the Asterisk Log.  However, this Module is only useful when you want to view a very recent event in the Asterisk Log. 
+
 
For a more detailed view of your Asterisk Logfiles, access the command prompt of the machine that you installed Asterisk on.  You can do so by physically accessing the machine, or by using an SSH client to access the command prompt from another machine.  If you are using a Windows machine, you can use a free program called Putty to access the command prompt.  You can download Putty here.  Putty has an added advantage in that you can easily cut and paste to and from Putty, and you cannot do so while accessing the command line from the machine that hosts your PBX.
+
Asterisk logfile 模块支持非常方便的查看手段来检查Asterisk的日志。 但是这个模块仅支持最近asterisk 事件。<br/>
Log-in to your machine using the username "root" and the root password when you set-up your machine.
+
 
After you log-in, you can access the logfiles by typing:
+
更多详细的日志文件记录,用户可以通过SSH 登录到PBX服务器来进行查看。<br/>
cd /var/log/asterisk
+
使用SSH登录到PBX服务器,用户名称为root 帐号和root密码。<br/>
at the command prompt.
+
登录后,用户可以看到各种asterisk日志文件<br/>
To see a list of the logfiles, type:
+
cd /var/log/asterisk <br/>
ls -l
+
at the command prompt. <br/>
at the command prompt.
+
To see a list of the logfiles, type: <br/>
Typically, today's logfile is called "full" and logfiles from prior days are named "full.xxx" or full-xxx", where xxx is a number of some kind.
+
ls -l <br/>
If you want to view and search today's logfiles in a text editor, type:
+
 
nano full
+
通常情况下,文件命名以"full" 和日期命名,例如 "full.xxx" 或者 full-xxx",这里xxx 是日期时间。<br/>
at the command prompt.  This will open up the logfile in a text editor called "nano." 
+
通过VI 或者其他linux 文本编辑器来查看文件,这里使用nano: <br/>
Nano will show you the commands you can use at the bottom of the screen.  The caret (^) character before a command indicates that you should hit the CTRL button.  In other words "^G  Get Help" means that you should hit CTRL-G to get to Nano's help screen.
+
nano full <br/>
You can then page up or down, and use CTRL-W to search the Logfile.  When you're done, hit CTRL-X to exit.
+
 
If you want to open a prior day's logfiles, replace the word "full" in the example above with the name of the file. 
+
查看文件,执行: <br/>
Note:  If you inadvertently save the Logfile, Asterisk may stop logging for the day.  If you do so, you can reset Asterisk and FreePBX by typing:
+
'''nano tempfile''' <br/>
amportal restart
+
 
Note:  This command will wait up to 120 seconds for all calls to end.  If the calls have not ended within 120 seconds, they will be terminated.  You can change the amount of time that the system will wait before terminating the calls in the Advanced Settings Module.
+
完成以后,执行 CTRL-X 退出。<br/>
Another way to easily view logfile information is to use the Linux grep command.  For example, to view a list of all the entries in today's logfile indicating that a Trunk is lagged or UNREACHABLE, you could type:
+
删除 temp 文件: <br/>
grep "is now" full
+
'''rm tempfile''' <br/>
at the command prompt. 
+
在linux 环境下,用户可以通过CLI 命令,查看实时日志: <br/>
Note:  the grep command is case sensitive.  So, "Lagged" will not pull up entries that say "lagged" or "LAGGED".  Also, as above, if you want to view prior day's logfiles, replace full with the name of the logfile.
+
'''asterisk -r''' <br/>
If the results are too long, you can use grep to put the "is now" entries in a new file that you can then view in nano.  For example, to copy all entries in today's logfile that contain "is now" into a file called tempfile, type:
+
退出,执行命令 '''exit''' <br/>
grep "is now" full > tempfile
+
 
at the command prompt. 
+
另外,用户也可以通过命令来查看log日志文件: <br/>
To view the file, type:
+
 
nano tempfile
+
<pre>
While in nano, you can use CTRL-W to search, and <PAGE UP> and <PAGE DOWN> to page up and page down.  CTRL-W followed by CTRL-V will take you to the last line in the Log.
+
When you're done in nano, hit CTRL-X to exit. 
+
You can delete the tempfile by typing:
+
rm tempfile
+
You can also view the Asterisk log in real-time by entering the Asterisk Command Line Interface:
+
asterisk -r
+
To exit, type
+
exit
+
Alternatively, you can view the logfile in real-time using tail:
+
 
cd /var/log/asterisk
 
cd /var/log/asterisk
 
tail -f full
 
tail -f full
When you're done, hit CTRL-C to exit.
+
</pre>
 +
 
 +
完成以后,执行CTRL-C 退出。

2015年10月25日 (日) 15:51的最新版本

Asterisk Logfiles

Asterisk logfile 模块支持非常方便的查看手段来检查Asterisk的日志。 但是这个模块仅支持最近asterisk 事件。

更多详细的日志文件记录,用户可以通过SSH 登录到PBX服务器来进行查看。
使用SSH登录到PBX服务器,用户名称为root 帐号和root密码。
登录后,用户可以看到各种asterisk日志文件
cd /var/log/asterisk
at the command prompt.
To see a list of the logfiles, type:
ls -l

通常情况下,文件命名以"full" 和日期命名,例如 "full.xxx" 或者 full-xxx",这里xxx 是日期时间。
通过VI 或者其他linux 文本编辑器来查看文件,这里使用nano:
nano full

查看文件,执行:
nano tempfile

完成以后,执行 CTRL-X 退出。
删除 temp 文件:
rm tempfile
在linux 环境下,用户可以通过CLI 命令,查看实时日志:
asterisk -r
退出,执行命令 exit

另外,用户也可以通过命令来查看log日志文件:

cd /var/log/asterisk
tail -f full

完成以后,执行CTRL-C 退出。