วันอังคารที่ 25 มิถุนายน พ.ศ. 2556

FreeRADIUS config accounting log

Standard


           การปรับแต่ง accounting log ตอนที่ user login เข้ามาที่ radius server โดยที่ไฟล์ config อยู่ที่
/etc/raddb/modules/detail
ค่า default ของ config file จะเป็น
detailfile = ${radacctdir}/%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}}/detail-%Y%m%d

ซึ่งจาก default นั้นทำให้จัดการได้ยาก เลยต้องการจะเปลี่ยนเป็น เก็บ log ใน folder ชื่อของ user และเก็บไฟล์ log เรียงตามวัน
detailfile = ${radacctdir}/%{User-Name}/%Y-%m-%d.log
 โดยที่
${radacctdir} คือ folder ของ radius log folder  (อยู่ใน config ของ radius, file radiusd.conf) ซึ่ง default คือ /var/log/radius/radacct/
%{User-Name} คือ ชื่อ user name ของผู้ใช้งาน
%Y คือ ปี ค.ศ.
%m คือ เดือน
%d คือ วัน
%{Client-IP-Address} คือ IP ของ user
%{Packet-Src-IP-Address} คือ IP ของ access point

สั่งเกตว่า ตัวที่นำหน้าด้วย $ จะคือ config  ส่วน % คือข้อมูลจากตัวแปร



ENV : CentOS release 6.2 (Final) , FreeRADIUS Version 2.1.10

Related Posts:

  • Update openssl on CentOS 6 fix bug Heartbleed     จาก bug Heartbleed อันโด่งดัง เลยเกินความรนรานจาก https ที่เปิดใช้ไว้บน server ที่เป็น public ip เลยต้องมาน่าอัพเดตกัน แต่ทีน… Read More
  • Install mysql on CentOS Install Mysql yum -y install mysql mysql-server On Service mysqld chkconfig mysqld on Start Service mysqld service mysqld start Set Mysql … Read More
  • Compile tomcat native lib for CentOS 6      จดไว้กันลืมหน่อย ตอนแรกผมต้อง config tomat6 ให้ใช้งานบน https แล้วตอนลงมันไม่มี lib libtcnative-1.so มาให้เลยต้อง compile เอ… Read More
  • Install freeRADIUS with MySQL Database on CensOS 6 Install service and lib $yum install -y mysql mysql-server  httpd php php-pecl-apc php-cli php-pear php-pdo php-mysql php-pgsql php-pecl… Read More
  • nginx + php + oci8 on CentOS 6.4 1.Installation      1.1. download lasted repo #wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm … Read More

0 ความคิดเห็น:

แสดงความคิดเห็น