Geont Posted September 16, 2021 Share Posted September 16, 2021 Коллеги, прошу помощи. Никак не могу сообразить, каков будет аналог команды ndmq -p "interface PPPoE0 (no)connect via GigabitEthernet1" -P message на REST API? Иными словами, нужно передернуть PPPoE подключение. Quote Link to comment Share on other sites More sharing options...
Geont Posted September 23, 2021 Author Share Posted September 23, 2021 Приветствую и прошу помощи: Как через rest api выполнить запрос ip host my.local 192.168.111.111? Что-то вроде wget -qO - --post-data='[{"ip":{"host":{"my.local 192.168.111.111"}}}]' http://localhost:79/rci/ но так не работает. И как потом выполнить no ip host my.local? Quote Link to comment Share on other sites More sharing options...
TheBB Posted September 23, 2021 Share Posted September 23, 2021 5 часов назад, Geont сказал: Приветствую и прошу помощи: Скрытый текст ~ # ~ # wget -qO - localhost:79/rci/ip/host; echo { } ~ # ~ # wget -qO - --post-data='[{"domain":"my.comp1","address":"192.168.1.33"}]' localhost:79/rci/ip/host; echo [ { "status": [ { "status": "message", "code": "22544396", "ident": "Dns::Manager", "source": "", "warning": "no", "message": "added static record for \"my.comp1\", address 192.168.1.33." } ] } ] ~ # wget -qO - --post-data='[{"domain":"my.comp2","address":"192.168.1.34"}]' localhost:79/rci/ip/host; echo [ { "status": [ { "status": "message", "code": "22544396", "ident": "Dns::Manager", "source": "", "warning": "no", "message": "added static record for \"my.comp2\", address 192.168.1.34." } ] } ] ~ # ~ # wget -qO - localhost:79/rci/ip/host; echo [ { "domain": "my.comp1", "address": "192.168.1.33" }, { "domain": "my.comp2", "address": "192.168.1.34" } ] ~ # wget -qO - --post-data='[{"no":true,"domain":"my.comp1","address":"192.168.1.33"}]' localhost:79/rci/ip/host; echo [ { "status": [ { "status": "message", "code": "22544397", "ident": "Dns::Manager", "source": "", "warning": "no", "message": "deleted record \"my.comp1\", address 192.168.1.33." } ] } ] ~ # wget -qO - localhost:79/rci/ip/host; echo [ { "domain": "my.comp2", "address": "192.168.1.34" } ] ~ # wget -qO - --post-data='[{"no":true,"domain":"my.comp2","address":"192.168.1.34"}]' localhost:79/rci/ip/host; echo [ { "status": [ { "status": "message", "code": "22544397", "ident": "Dns::Manager", "source": "", "warning": "no", "message": "deleted record \"my.comp2\", address 192.168.1.34." } ] } ] ~ # ~ # wget -qO - localhost:79/rci/ip/host; echo { } ~ # 3 Quote Link to comment Share on other sites More sharing options...
Le ecureuil Posted October 6, 2021 Share Posted October 6, 2021 В 16.09.2021 в 12:23, Geont сказал: Коллеги, прошу помощи. Никак не могу сообразить, каков будет аналог команды ndmq -p "interface PPPoE0 (no)connect via GigabitEthernet1" -P message на REST API? Иными словами, нужно передернуть PPPoE подключение. Включить: curl -X POST -d '{}' "http://localhost:79/rci/interface/connect?name=PPPoE0&via=ISP" Выключить: curl -X DELETE http://localhost:79/rci/interface/connect?name=PPPoE0 1 Quote Link to comment Share on other sites More sharing options...
TheBB Posted October 7, 2021 Share Posted October 7, 2021 Понадобилось отсканировать документ и... oops! "Саня" (sane) в ступоре: ... I [Oct 7 13:22:39] saned[4602]: check_host: access by remote host: IP.ADD.RE.SS I [Oct 7 13:22:40] saned[4602]: check_host: getaddrinfo for local hostname failed: Temporary failure in name resolution I [Oct 7 13:22:40] saned[4602]: init: access by host IP.ADD.RE.SS denied I [Oct 7 13:22:40] saned[4602]: saned exiting ... чиним-с... Скрытый текст смотрим ~ # echo $HOSTNAME KN-1910 ~ # ~ # ping -c 3 $HOSTNAME ping: bad address 'KN-1910' ~ # вызываем фиксиков ~ # /opt/etc/init.d/S00fix_hosts start ~ # ~ # ping -c 3 $HOSTNAME PING KN-1910 (IP.ADD.RE.SS): 56 data bytes 64 bytes from IP.ADD.RE.SS: seq=0 ttl=64 time=0.684 ms 64 bytes from IP.ADD.RE.SS: seq=1 ttl=64 time=0.463 ms 64 bytes from IP.ADD.RE.SS: seq=2 ttl=64 time=0.550 ms --- KN-1910 ping statistics --- 3 packets transmitted, 3 packets received, 0% packet loss round-trip min/avg/max = 0.463/0.565/0.684 ms ~ # "велосипед" ~ # cat /opt/etc/init.d/S00fix_hosts #!/bin/sh [ "$1" != "start" ] && exit 0 IP="$(wget -qO - localhost:79/rci/show/interface/Home/address | sed 's,",,g')" if ! ping -c 3 "$(echo $HOSTNAME)" > /dev/null 2>&1; then echo "$IP $HOSTNAME" >> /etc/hosts fi ~ # Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.