ROS软路由论坛 ROSABC.com 网络方案网络工程交流

 找回密码
 会员注册

QQ登录

只需一步,快速开始

查看: 6345|回复: 2

[交流] 一个奇怪的问题,怎样在脚本中取得VPN用户的流量情况

[复制链接]
发表于 2010-6-30 17:25:49 | 显示全部楼层 |阅读模式

马上注册成为ROSABC会员,随时发帖回复。

您需要 登录 才可以下载或查看,没有账号?会员注册

x
我想在脚本中取得VPN用户的流量情况,但取出的bytes和packets均为空。取其它字段,如uptime,name等都是正常的。本以为只是ROS软路由2.8的问题,但在ROS软路由3.2中测试,仍然为空,是不是很奇怪?是不是我方法不对?

[admin@MikroTik] > :put [/ppp act get 0 ?]
ValueName ::= address | bytes | caller-id | encoding | limit-bytes-in | ...
radius -- Defines whether user is using RADIUS server for authentication
encoding -- Encoding method
service -- Service name
session-id -- Specific session identifier
bytes -- The count of bytes
packets -- The count of packets

uptime -- Time when user is up
address -- User address
name -- User name
caller-id -- User's IP address for PPTP or MAC address for PPoE
limit-bytes-out -- maximum amount of bytes user can receive
limit-bytes-in -- maximum amount of bytes user can transmit

[admin@MikroTik] > :put [/ppp act get 0 service]
pptp
[admin@MikroTik] > :put [/ppp act get 0 bytes]

[admin@MikroTik] >
发表于 2010-7-2 03:57:33 | 显示全部楼层
[admin@nat_office] /ppp active> :global a [/ppp active   get 0 bytes]        
[admin@nat_office] /ppp active> :put $a
17
[admin@nat_office] /ppp active>

:global a [/ppp active   get 0 bytes]
通过一个变量可以获取,直接不能显示
发表于 2010-7-2 23:06:52 | 显示全部楼层
可惜我在ros2.8.28以及3.2下,用变量取bytes值,都还是为空:

[admin@MikroTik] > :global a
[admin@MikroTik] > t a [/ppp active get 0 bytes]
[admin@MikroTik] > :put $a                          

[admin@MikroTik] >

yus你用的什么版本
您需要登录后才可以回帖 登录 | 会员注册

本版积分规则

不良信息举报Q:2000617

软路由

不良信息举报Q:2000617|Archiver|ROS软路由论坛 ROSABC.com 网络方案网络工程交流

GMT+8, 2024-5-19 17:06 , Processed in 0.067464 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表