-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gNMIc is unable to scrape data on Port 9273 #528
Comments
your path in the gnmic config differs from the one you use in the cli example Try removing the leading forward slash:
|
That doesn't seem to be the issue, but I replicated the it regardless, and the problem still persists. |
Hello everyone!!! I'm also having problems getting the information collection to work correctly with Huawei equipment. Based on the tests I've done, using the openconfig models doesn't work, so I downloaded the models that Huawei provides from the repository: https://github.com/Huawei/yang. To do this collection, I managed to use their model, which is from the file: huawei-ifm.yang, as follows: (.venv) g0004830@p-br-pr-cta-gt2-mk8s-01:~/huawei-yang/yang/network-router/8.22.0/ne40e-x8x16$ pyang -f tree huawei-ifm.yang
However, it is not very complete, like the IP counters part is not included. I don't really understand how YANG models work when they extend from another model using the augment option. There is another yang file in this same repository which is: huawei-ip-statistics.yang Which has the following content: module: huawei-ip-statistics augment /ifm:ifm/ifm:interfaces/ifm:interface/ip:ipv4/ip:state: I understand that it is extending what comes from huawei-ifm.yang, but what I couldn't do was define how the path is passed to query what is in the IP statistics, that is, how to use a model with augment. I used gnmic generate but the path it provided me didn't work, example (path start with ifm example, but I need pass huawei-ifm before like yang file): /ifm/interfaces/interface[name=]/ipv4/state/statistics/in-bcast-octets /ifm/interfaces/interface[name=]/ipv4/state/statistics/in-bcast-pkts /ifm/interfaces/interface[name=]/ipv4/state/statistics/in-mcast-octets /ifm/interfaces/interface[name=]/ipv 4/state/statistics/in-mcast-pkts /ifm/interfaces/interface[name=]/ipv4/state/statistics/in-octets / ifm/interfaces/interface[name=]/ipv4/state/statistics/in-rate-bits /ifm/interfaces/interface[name=]/ipv4/state/statistics/in-rate-byte-bandwidth-usage /ifm/interfaces/interface[name=]/ipv4/state/statistics/in-rate-pkts /ifm/interfaces/interface[name=]/ipv4 /state/statistics/in-receives /ifm/interfaces/interface[name=]/ipv4/state/statistics/in-ucast-octets In summary I don't set path using a file with augment, the other files with no augment from Huawei working. |
I got api from huawei... this example with rpc, how to convert to gnmic get path:
Tks, |
guys, I managed to advance a little, I got to the huawei-ip module which is an augment of huawei-ifm, doing it like this: gnmic --timeout 60s -a 10.10.10.10:57400 -u admin -p admin --insecure get --path huawei-ifm:ifm/interfaces/interface[name=GigabitEthernet0/3/6]/huawei-ip:ipv4/state/ But, this module huawei-ip-statistics not work, this status is: gnmic --timeout 60s -a 10.10.10.10: 57400 -u admin -p admin --insecure get --path huawei-ifm:ifm/interfaces/interface[name=GigabitEthernet0/3/6]/huawei-ip:ipv4/state/huawei-ip-statistics:statistics/in-receives |
Hello, After several hours trying to understand and solve the problem, I would like to share here how I managed to do it. The path only works when the device's interface configuration has statistics enabled and in forward mode, which is not standard on Huawei, in fact, something that only Huawei does... lol. Here is the interface configuration and the command to get the counters for both IPv4 and IPv6: interface GigabitEthernet0/3/6 return Huawei's doc. The statistic mode forward command enables a device's all main physical interfaces and logical interfaces to collect traffic statistics based on IPv4 and IPv6 forwarding. The undo statistic mode forward command restores the default traffic statistics collection mode. By default, an interface collects traffic statistics based on the destination MAC address in packets. gnmic --timeout 60s -a 10.10.10.10:57400 -u admin -p admin--insecure subscribe --path huawei-ifm:ifm/interfaces/interface[name=GigabitEthernet0/3/6]/huawei-ip:ipv6/state/huawei-ip-statistics:statistics --stream-mode sample @arbabali999 I added you to my LinkedIn, if you want to exchange ideas about monitoring Huawei equipment, just call. |
Thank you for your help. Unfortunately, my Huawei CE8850 device lacks a command specifically for "statistic mode forwarding." I did enable "statistic enable," and I can view the statistics using the get command. However, when I add the subscription in gnmic.yml, the statistics briefly appear on gnmic:9273/metrics. After refreshing the page, though, the data stops reflecting within a minute. sudo gnmic -a 10.1.1.1:57400 --insecure -u admin -p admin -d get --path huawei-ifm:ifm/interfaces/interface[ifName=Eth-Trunk5] |
Hi,
I have successfully integrated Nokia and Juniper Routers with gnmic and successfully visualizing telemetry stats on Grafana. But with Huawei, i am unable to scrap data on port 9273 for Prometheus, hence, i am not able to visualize it on Grafana.
gnmic.yml:
10.1.1.1:
username: admin
password: admin
subscriptions:
- dplc_interface_stats
subscriptions:
dplc_interface_stats:
paths:
- "openconfig-interfaces:interfaces/interface[name=100GE1/0/2]/state/counters"
mode: stream
stream-mode: sample
sample-interval: 5s
Result:
sudo gnmic -a 10.1.1.1:57400 --insecure -u admin -p admin -d get --path openconfig-interfaces:interfaces/interface[name=100GE1/0/2]/state/counters
2024/10/10 11:11:49.187280 /home/runner/go/pkg/mod/google.golang.org/[email protected]/grpclog/logger.go:53: [gnmic] [core] [Channel #1] Channel Connectivity change to READY
[
{
"source": "10.1.1.1:57400",
"timestamp": 1728540709375863000,
"time": "2024-10-10T11:11:49.375863+05:00",
"updates": [
{
"Path": "openconfig-interfaces:interfaces/interface[name=100GE1/0/2]/state/counters",
"values": {
"openconfig-interfaces:interfaces/interface/state/counters": {
"in-broadcast-pkts": "3753",
"in-discards": "0",
"in-errors": "2252",
"in-fcs-errors": "1595",
"in-multicast-pkts": "12466908",
"in-octets": "8740684804016284",
"in-unicast-pkts": "17446988040687",
"in-unknown-protos": "0",
"last-clear": "1724223418253000000",
"out-broadcast-pkts": "3396",
"out-discards": "28727127",
"out-errors": "0",
"out-multicast-pkts": "15091273",
"out-octets": "23302406015041723",
"out-unicast-pkts": "20895639374896"
}
}
}
]
}
]
Here i can see the statistics but they are not scrapping on port 9273 i.e., gnmic.:9273/metrics where Nokia and Juniper stats are successfully exposing. Refer below snapshot.
Note: I have hide the device IPs that are scrapping data successfully for security reasons.
Can you please assist in resolving the issue.
The text was updated successfully, but these errors were encountered: