Назад | Перейти на главную страницу

учет в модуле rlm_rest freeradius

Я работаю над проектом Hotspot с Coova Chilli и Freeradius. Я использую FreeRADIUS в последней стабильной версии 3.0.11.

Я создал свой конфигурационный файл для отдыха и сайтов в соответствии с этим сообщением: Настройка модуля rlm_rest в FreeRadius

К сожалению, информации о настройке учета через rest нет, поэтому я попробовал следующее: sites-enabled / default:

accounting {
    rest
    detail
    unix
    exec
    attr_filter-accounting_response
}

с включенными модами / отдых:

accounting {
        uri = "${..connect_uri}/aaa/accounting/sessions/%{Acct-Unique-Session-ID}"
        method = 'post'
        body = 'json'
}

Но данные в мою службу REST не отправляются. Дана просто пустая строка ...

В режиме отладки FreeRadius (radiusd -X) печатается следующее:

(10)   accounting {
rlm_rest (rest): Reserved connection (13)
(10) rest: Expanding URI components
(10) rest: EXPAND http://SERVERIP:PORT
(10) rest:    --> http://SERVERIP:PORT
(10) rest: EXPAND /radius/rest/aaa/accounting/sessions/%{Acct-Unique-Session-ID}
(10) rest:    --> /radius/rest/aaa/accounting/sessions/8f7d662e6afaaa0427598e03cc908379
(10) rest: Sending HTTP POST to "http://SERVERIP:PORT/radius/rest/aaa/accounting/sessions/8f7d662e6afaaa0427598e03cc908379"
(10) rest: Encoding attribute "User-Name"
(10) rest: Encoding attribute "NAS-IP-Address"
(10) rest: Encoding attribute "Service-Type"
(10) rest: Encoding attribute "Called-Station-Id"
(10) rest: Encoding attribute "Calling-Station-Id"
(10) rest: Encoding attribute "NAS-Identifier"
(10) rest: Encoding attribute "NAS-Port-Type"
(10) rest: Encoding attribute "Acct-Status-Type"
(10) rest: Encoding attribute "Acct-Input-Octets"
(10) rest: Encoding attribute "Acct-Output-Octets"
(10) rest: Encoding attribute "Acct-Session-Id"
(10) rest: Encoding attribute "Acct-Session-Time"
(10) rest: Encoding attribute "Acct-Input-Packets"
(10) rest: Encoding attribute "Acct-Output-Packets"
(10) rest: Encoding attribute "Acct-Input-Gigawords"
(10) rest: Encoding attribute "Acct-Output-Gigawords"
(10) rest: Encoding attribute "Event-Timestamp"
(10) rest: Encoding attribute "ChilliSpot-Version"
(10) rest: Returning 1022 bytes of JSON data (buffer full or chunk exceeded)
(10) rest: Encoding attribute "ChilliSpot-Max-Total-Gigawords"
(10) rest: Encoding attribute "FreeRADIUS-Acct-Session-Start-Time"
(10) rest: Encoding attribute "WISPr-Location-ID"
(10) rest: Encoding attribute "WISPr-Location-Name"
(10) rest: Encoding attribute "Acct-Unique-Session-Id"
(10) rest: Encoding attribute "Attr-26.14559.40"
(10) rest: Encoding attribute "Attr-26.14559.41"
(10) rest: Encoding attribute "Attr-26.14559.42"
(10) rest: Processing response header
(10) rest:   Status : 100 (Continue)
(10) rest: Continuing...
(10) rest: Processing response header
(10) rest: ERROR: Malformed HTTP header: Missing HTTP version
(10) rest: ERROR: Received 19 bytes of response data: Content-Length: 0
(10) rest: ERROR: Request failed: 23 - Failed writing received data to disk/application
(10) rest: ERROR: Server returned no data
rlm_rest (rest): Released connection (13)
rlm_rest (rest): Need 1 more connections to reach 10 spares
rlm_rest (rest): Opening additional connection (15), 1 of 30 pending slots used
rlm_rest (rest): Connecting to "http://SERVERIP:PORT/radius/rest"
(10)     [rest] = fail
(10)   } # accounting = fail

Если я попробую такой тест (просто неполный образец в спецификации JSON модуля rest):

curl -X POST -H "Content-Type: application/json" --data '{ "User-Name": {"type":"string","value":["elise"]}, "NAS-IP-Address": {"type":"ipaddr","value":["10.1.0.1"]}, "NAS-Port": {"type":"integer","value":["1"]}, "Framed-IP-Address": {"type":"ipaddr","value":["10.1.0.177"]}, "Called-Station-Id": {"type":"string","value":["B8-AC-6F-8D-00-CA"]}, "NAS-Identifier": {"type":"string","value":["nas01"]}, "Acct-Status-Type": {"type":"integer","value":[1]}, "Acct-Session-Id": {"type":"string","value":["56f00f8100000000"]}, "Event-Timestamp": {"type":"date","value":["Jul 29 2015 16:06:40 CEST"]}, "WISPr-Location-ID": {"type":"string","value":["isocc=,cc=,ac=,network=MeteringService_GmbH,"]}, "WISPr-Location-Name": {"type":"string","value":["KomDSL_Hotspot"]}, "Acct-Unique-Session-Id": {"type":"string","value":["8f7d662e6afaaa0427598e03cc908379"]} } ' http://SERVER_PATH/aaa/accounting/sessions/8f7d662e6afaaa0427598e03cc908379

все в порядке, так что моя служба REST вроде работает ....

Остальные разделы (аутентификация и т. Д.) Работают с method = 'get', и все в порядке.

Кто-нибудь реализовал эту функцию и может мне помочь?

После ответов на serverfaul.com, может быть, у Аррана Кадбард-Белла есть ответ?

Жду вашей помощи!

Атрибут data отсутствует в остальной конфигурации.

В модах с включенным / отдыхом:

accounting {
    uri = "${..connect_uri}/aaa/accounting/sessions/%{Acct-Unique-Session-ID}"
    method = 'post'
    body = 'json'
    data = '{ "User-Name": {"type":"string","value":["elise"]}, "NAS-IP-Address": {"type":"ipaddr","value":["10.1.0.1"]}, "NAS-Port": {"type":"integer","value":["1"]}, "Framed-IP-Address": {"type":"ipaddr","value":["10.1.0.177"]}, "Called-Station-Id": {"type":"string","value":["B8-AC-6F-8D-00-CA"]}, "NAS-Identifier": {"type":"string","value":["nas01"]}, "Acct-Status-Type": {"type":"integer","value":[1]}, "Acct-Session-Id": {"type":"string","value":["56f00f8100000000"]}, "Event-Timestamp": {"type":"date","value":["Jul 29 2015 16:06:40 CEST"]}, "WISPr-Location-ID": {"type":"string","value":["isocc=,cc=,ac=,network=MeteringService_GmbH,"]}, "WISPr-Location-Name": {"type":"string","value":["KomDSL_Hotspot"]}, "Acct-Unique-Session-Id": {"type":"string","value":["8f7d662e6afaaa0427598e03cc908379"]} }'
}

Заметка вы должны заменить данные примера на Атрибуты, предоставленные FreeRadius, например %{User-Name}