pptpd PPP VPN LOG
- font size decrease font size increase font size
- Print Email
vpn 服务,但通过last查看的时候,只有登录的IP信息,
无法查看VPN客户端登录的用户名,登录地址,断开时间等信息。
请同事写了两个脚本。用于记录登录信息及登出信息。记一下,以备后用
修改ip-up ,ip-down文件,增加以下内容(export PATH 行后面),将日志信息记录到
/var/log/pptpd.log文件 中
vim /etc/ppp/ip-up
echo "" >> /var/log/pptpd.log
echo "IP UP \
`date -d today +%F_%T` \
$6 \
$PEERNAME \
$1 \
$5" >> /var/log/pptpd.log
echo "" >> /var/log/pptpd.log
echo "IP UP \
`date -d today +%F_%T` \
$6 \
$PEERNAME \
$1 \
$5" >> /var/log/pptpd.log
vim /etc/ppp/ip-down文件。ip-down写入pptpd.log与最后一个 ip-up进行配对,以方便查看
tac /var/log/pptpd.log | while read line
do
_tmphead=$(echo $line | cut -d" " -f1,2)
_tmptime=$(echo $line | cut -d" " -f3)
_tmpuser=$(echo $line | cut -d" " -f5)
if [ "IP UP" = "$_tmphead" -a "$PEERNAME" = "$_tmpuser" ]
then
_rep_line="$line"
sed -i "s/$line/$_rep_line\nIP DOWN \
`date -d today +%F_%T` \
$6 \
$PEERNAME \
$1 \
$5/" /var/log/pptpd.log
break
fi
done
Last modified onSaturday, 05 January 2013 10:06
( ! ) Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 169 | ||||
---|---|---|---|---|
Call Stack | ||||
# | Time | Memory | Function | Location |
1 | 0.0010 | 413728 | {main}( ) | .../index.php:0 |
2 | 0.1187 | 4718232 | Joomla\CMS\Application\SiteApplication->execute( ) | .../index.php:49 |
3 | 0.1187 | 4718232 | Joomla\CMS\Application\SiteApplication->doExecute( ) | .../CMSApplication.php:196 |
4 | 0.3207 | 12446208 | Joomla\CMS\Application\SiteApplication->dispatch( ) | .../SiteApplication.php:233 |
5 | 0.3212 | 12470552 | Joomla\CMS\Component\ComponentHelper::renderComponent( ) | .../SiteApplication.php:194 |
6 | 0.3220 | 12525880 | Joomla\CMS\Component\ComponentHelper::executeComponent( ) | .../ComponentHelper.php:377 |
7 | 0.3222 | 12554704 | require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ) | .../ComponentHelper.php:402 |
8 | 0.3327 | 12990112 | K2ControllerItem->execute( ) | .../k2.php:64 |
9 | 0.3327 | 12990112 | K2ControllerItem->display( ) | .../BaseController.php:710 |
10 | 0.3427 | 13715312 | K2ControllerItem->display( ) | .../item.php:78 |
11 | 0.3427 | 13715312 | K2ControllerItem->display( ) | .../controller.php:19 |
12 | 0.3470 | 14111680 | Joomla\CMS\Cache\Controller\ViewController->get( ) | .../BaseController.php:663 |
13 | 0.3492 | 14132048 | K2ViewItem->display( ) | .../ViewController.php:102 |
14 | 0.4114 | 17099768 | K2ViewItem->display( ) | .../view.html.php:742 |
15 | 0.4114 | 17099768 | K2ViewItem->loadTemplate( ) | .../HtmlView.php:230 |
16 | 0.4175 | 17279968 | include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ) | .../HtmlView.php:701 |
- Published in VPN
- Read 3123 times
( ! ) Notice: Only variables should be assigned by reference in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 478 | ||||
---|---|---|---|---|
Call Stack | ||||
# | Time | Memory | Function | Location |
1 | 0.0010 | 413728 | {main}( ) | .../index.php:0 |
2 | 0.1187 | 4718232 | Joomla\CMS\Application\SiteApplication->execute( ) | .../index.php:49 |
3 | 0.1187 | 4718232 | Joomla\CMS\Application\SiteApplication->doExecute( ) | .../CMSApplication.php:196 |
4 | 0.3207 | 12446208 | Joomla\CMS\Application\SiteApplication->dispatch( ) | .../SiteApplication.php:233 |
5 | 0.3212 | 12470552 | Joomla\CMS\Component\ComponentHelper::renderComponent( ) | .../SiteApplication.php:194 |
6 | 0.3220 | 12525880 | Joomla\CMS\Component\ComponentHelper::executeComponent( ) | .../ComponentHelper.php:377 |
7 | 0.3222 | 12554704 | require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ) | .../ComponentHelper.php:402 |
8 | 0.3327 | 12990112 | K2ControllerItem->execute( ) | .../k2.php:64 |
9 | 0.3327 | 12990112 | K2ControllerItem->display( ) | .../BaseController.php:710 |
10 | 0.3427 | 13715312 | K2ControllerItem->display( ) | .../item.php:78 |
11 | 0.3427 | 13715312 | K2ControllerItem->display( ) | .../controller.php:19 |
12 | 0.3470 | 14111680 | Joomla\CMS\Cache\Controller\ViewController->get( ) | .../BaseController.php:663 |
13 | 0.3492 | 14132048 | K2ViewItem->display( ) | .../ViewController.php:102 |
14 | 0.4114 | 17099768 | K2ViewItem->display( ) | .../view.html.php:742 |
15 | 0.4114 | 17099768 | K2ViewItem->loadTemplate( ) | .../HtmlView.php:230 |
16 | 0.4175 | 17279968 | include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ) | .../HtmlView.php:701 |