Subversion Repositories ALCASAR

Rev

Rev 2513 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log

sqlcounter dailycounter {
        sql_module_instance = sql
        counter_name = Daily-Session-Time
        check_name = Max-Daily-Session
        reply_name = Session-Timeout
        key = User-Name
        reset = daily
        query = "SELECT IFNULL((SELECT SUM(acctsessiontime - GREATEST((%%b - UNIX_TIMESTAMP(acctstarttime)), 0)) FROM radacct WHERE username='%{${key}}' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '%%b'), 0)"
}

sqlcounter monthlycounter {
        sql_module_instance = sql
        counter_name = Monthly-Session-Time
        check_name = Max-Monthly-Session
        reply_name = Session-Timeout
        key = User-Name
        reset = monthly
        query = "SELECT IFNULL((SELECT SUM(acctsessiontime - GREATEST((%%b - UNIX_TIMESTAMP(acctstarttime)), 0)) FROM radacct WHERE username='%{${key}}' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '%%b'), 0)"
}

sqlcounter noresetcounter {
        sql_module_instance = sql
        counter_name = Max-All-Session-Time
        check_name = Max-All-Session
        key = User-Name
        reset = never
        query = "SELECT IFNULL(SUM(AcctSessionTime), 0) FROM radacct WHERE username='%{${key}}'"
}

sqlcounter expire_on_login {
        sql_module_instance = sql
        counter_name = Alcasar-Expire-After-Initial-Login
        check_name = Alcasar-Expire-After
        key = User-Name
        reset = never
        query = "SELECT IFNULL((SELECT TIME_TO_SEC(TIMEDIFF(NOW(), acctstarttime)) FROM radacct WHERE username='%{${key}}' ORDER BY acctstarttime LIMIT 1), 0)"
}

sqlcounter counterCoovaChilliMaxTotalOctetsDaily {
        sql_module_instance = sql
        counter_name = CoovaChilli-Max-Total-Octets-Daily
        check_name = CoovaChilli-Max-Total-Octets-Daily
        counter_type = data
        reply_name = CoovaChilli-Max-Total-Octets
        key = User-Name
        reset = daily
        query = "SELECT IFNULL((SUM(AcctInputOctets + AcctOutputOctets)), 0) FROM radacct WHERE username='%{${key}}' AND UNIX_TIMESTAMP(AcctStartTime) + AcctSessionTime > '%%b'"
}

sqlcounter counterCoovaChilliMaxTotalOctetsMonthly {
        sql_module_instance = sql
        counter_name = CoovaChilli-Max-Total-Octets-Monthly
        check_name = CoovaChilli-Max-Total-Octets-Monthly
        counter_type = data
        reply_name = CoovaChilli-Max-Total-Octets
        key = User-Name
        reset = monthly
        query = "SELECT IFNULL((SUM(AcctInputOctets + AcctOutputOctets)),0) FROM radacct WHERE username='%{${key}}' AND UNIX_TIMESTAMP(AcctStartTime) + AcctSessionTime > '%%b'"
}