Skip to content
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

Netconf plugin commands without a key #22

Open
nitzan-tz opened this issue Dec 6, 2024 · 0 comments
Open

Netconf plugin commands without a key #22

nitzan-tz opened this issue Dec 6, 2024 · 0 comments

Comments

@nitzan-tz
Copy link

Hi,

I am playing with jts_telegraf netconf plugin outside of openjts and with Prometheus plugin but I think that the following issue is a general one
For subscriptions without a key like for the command "show task memory" there are no results if I am not specifying a key (Just add [0] as a key)

For example,
the subscription below doesn't work

  [[inputs.netconf_junos.subscription]]
    name = "junos_task_mem"
    junos_rpc = "<get-task-memory-information></get-task-memory-information>"
    fields = [
             "/task-memory-information/task-memory-in-use-size:int",
             "/task-memory-information/task-memory-in-use-avail:int",
             "/task-memory-information/task-memory-max-size:int",                          
             "/task-memory-information/task-memory-max-avail:int",
             "/task-memory-information/task-memory-free-size:int",
             ]
    sample_interval = "60s"

This one works (See the extra [0])

  [[inputs.netconf_junos.subscription]]
    name = "junos_task_mem"
    junos_rpc = "<get-task-memory-information></get-task-memory-information>"
    fields = [
             "/task-memory-information[0]/task-memory-in-use-size:int",
             "/task-memory-information[0]/task-memory-in-use-avail:int",
             "/task-memory-information[0]/task-memory-max-size:int",                          
             "/task-memory-information[0]/task-memory-max-avail:int",
             "/task-memory-information[0]/task-memory-free-size:int",
             ]
    sample_interval = "60s"

And this is the output on the device

<rpc-reply xmlns:junos="http://xml.juniper.net/junos/23.2R2.21-EVO/junos">
    <task-memory-information junos:style="brief">
        <task-memory-in-use-size>270656</task-memory-in-use-size>
        <task-memory-in-use-avail>1</task-memory-in-use-avail>
        <task-memory-max-size>393680</task-memory-max-size>
        <task-memory-max-avail>2</task-memory-max-avail>
        <task-memory-max-when>24/12/04 00:04:39</task-memory-max-when>
        <task-memory-free-size>15911548</task-memory-free-size>
    </task-memory-information>
    <cli>
        <banner></banner>
    </cli>
</rpc-reply>

Thanks

Nitzan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant