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

MIBS not Loaded after Update to 1.21.2 #10444

Closed
langweiler2020 opened this issue Jan 14, 2022 · 15 comments · Fixed by #10802
Closed

MIBS not Loaded after Update to 1.21.2 #10444

langweiler2020 opened this issue Jan 14, 2022 · 15 comments · Fixed by #10802
Assignees
Labels
area/snmp bug unexpected problem or unintended behavior

Comments

@langweiler2020
Copy link

Relevent telegraf.conf

[[inputs.snmp]]
  agents = [ "10.x.x.x","10.x.x.x" ]
  version = 2
  community = "public"
  interval = "60s"
#  path = ["/usr/share/snmp/mibs"]
#  path = ["/mibs"]
#  path = ["/root/.snmp/mibs"]

# System
name = "pan_system"
[[inputs.snmp.field]]
  name = "hostname"
  oid = ".1.3.6.1.2.1.1.5.0"
  is_tag = true
[[inputs.snmp.field]]
  name = "hrProcessorLoad.1"
  oid = ".1.3.6.1.2.1.25.3.3.1.2.1"
[[inputs.snmp.field]]
  name = "hrProcessorLoad.2"
  oid = ".1.3.6.1.2.1.25.3.3.1.2.2"
[[inputs.snmp.field]]
  name = "panSessionUtilization"
  oid = "PAN-COMMON-MIB::panSessionUtilization.0"
[[inputs.snmp.field]]
  name = "panSessionActiveTcp"
  oid = "PAN-COMMON-MIB::panSessionActiveTcp.0"
[[inputs.snmp.field]]
  name = "panSessionActiveUdp"
  oid = "PAN-COMMON-MIB::panSessionActiveUdp.0"
[[inputs.snmp.field]]
  name = "panSessionActiveICMP"
  oid = "PAN-COMMON-MIB::panSessionActiveICMP.0"
[[inputs.snmp.field]]
  name = "panGPGWUtilizationActiveTunnels"
  oid = "PAN-COMMON-MIB::panGPGWUtilizationActiveTunnels.0"

Logs from Telegraf

docker-compose up telegraf
Starting telegraf ... done
Attaching to telegraf
telegraf | 2022-01-14T09:19:59Z I! Starting Telegraf 1.21.2
telegraf | 2022-01-14T09:19:59Z I! Using config file: /etc/telegraf/telegraf.conf
telegraf | 2022-01-14T09:19:59Z I! Loaded inputs: cpu snmp
telegraf | 2022-01-14T09:19:59Z I! Loaded aggregators:
telegraf | 2022-01-14T09:19:59Z I! Loaded processors:
telegraf | 2022-01-14T09:19:59Z I! Loaded outputs: influxdb
telegraf | 2022-01-14T09:19:59Z I! Tags enabled: host=telegraf
telegraf | 2022-01-14T09:19:59Z I! [agent] Config: Interval:1m0s, Quiet:false, Hostname:"telegraf", Flush Interval:10s
telegraf | 2022-01-14T09:20:01Z E! [telegraf] Error running agent: could not initialize input inputs.snmp: initializing field panSessionUtilization: translating: cannot make PAN-COMMON-MIB::panSessionUtilization.0 numeric, please ensure all imported mibs are in the path

System info

telegraf 1.21.2 Docker 20.10.12

Docker

No response

Steps to reproduce

  1. Pull latest telegraf image
  2. start service

...

Expected behavior

Should be running fine with the PALOALTO Network MIBS

Actual behavior

Container is restarting permanently

Additional info

Running perfect on telegraf version 1.20.4

@langweiler2020 langweiler2020 added the bug unexpected problem or unintended behavior label Jan 14, 2022
@langweiler2020 langweiler2020 changed the title MIBS nint Loaded after Update to 1.21.2 MIBS not Loaded after Update to 1.21.2 Jan 14, 2022
@nward
Copy link

nward commented Jan 14, 2022

@langweiler2020 What is the exact filename and path for your Palo Alto MIB files?

@langweiler2020
Copy link
Author

Hello,

thx for answer
the MIBs are mounted into /usr/share/snmp/mibs and the name is: PAN-COMMON-MIB.txt
the complete configuration of the container just in case it helps is:
telegraf:
image: telegraf
restart: always
container_name: telegraf
hostname: telegraf
networks:
- vsphere-ueberwachung
volumes:
- /opt/container/conf/telegraf.conf:/etc/telegraf/telegraf.conf
- /opt/container/conf/PanOSMibs/9-1:/usr/share/snmp/mibs

in the 9-1 folder are all PanOS MIBs as well as the Standard MIBs of the Operating System

Best Regards

@nward
Copy link

nward commented Jan 14, 2022

Great - see the above issue referenced, and #10444.

Rename PAN-COMMON-MIB.txt to PAN-COMMON-MIB or downgrade to 1.20.4 until MIB parsing is fixed.

@langweiler2020
Copy link
Author

thank you very much :)

@Hipska
Copy link
Contributor

Hipska commented Feb 14, 2022

@langweiler2020 do you confirm this solved your issue?

@Hipska Hipska added the waiting for response waiting for response from contributor label Feb 14, 2022
@langweiler2020
Copy link
Author

Hello,

my issue is solved, works fine now tyvm :)
Best Regards

@telegraf-tiger telegraf-tiger bot removed the waiting for response waiting for response from contributor label Feb 14, 2022
@Hipska Hipska closed this as completed Feb 14, 2022
@reimda
Copy link
Contributor

reimda commented Mar 19, 2022

Hi @langweiler2020, we recently merged a change that should fix the MIB naming/parsing issue you ran into (see #10802). Could you test it by renaming your MIB file back to what it was when you had the problem (was it PAN-COMMON-MIB.txt?) and running a nightly build?

Nightly builds: https://github.com/influxdata/telegraf/blob/master/docs/NIGHTLIES.md

@langweiler2020
Copy link
Author

langweiler2020 commented Mar 21, 2022

Hi @reimda ,

we are running telegraf inside docker containers, but as far as i can see there are no containers with the nightly build on docker hub. is this korrekt ?

Best Regards

@reimda
Copy link
Contributor

reimda commented Mar 22, 2022

You are right, we currently don't have a docker container nightly build. If you're not able to test without one, I think it's ok. We've had positive responses about this change from a few other community members so we're still planning to include it in the next build.

I'll look into adding a nightly docker container build. I think it would be helpful for others too.

@Hipska Hipska linked a pull request Mar 23, 2022 that will close this issue
@senpro-ingwersenk
Copy link
Contributor

senpro-ingwersenk commented Jan 16, 2024

Hello!

This issue still persists in 1.26.1. I have manually written a MIB for a REDDOXX appliance (it's here) and imported it into our Nix configuration that we deploy to monitoring agents that run Telegraf and send data back to our InfluxDB instance.

The specific error I got is:

Jan 16 08:38:42 monitoring-agent telegraf[277470]: 2024-01-16T07:38:42Z E! [telegraf] Error running agent: could not initialize input inputs.snmp: initializing field SmtpReceiverConnectionsOut: translating: cannot make REDDOXX-MIB::SmtpReceiverConnectionsOut numeric, please ensure all imported mibs are in the path

When inspecting the generated Telegraf configuration, I can confirm that the file exists:

...in config:

[[inputs.snmp]]
agents = ["udp://(...):161"]
community = "(...)"
name = "reddoxx"
path = ["/nix/store/k4n42ym3fsqg3mkfc2qnr4ivkkc17f4d-mib-library/opt/mib-library/"]
retries = 5
timeout = "20s"
version = 2

...and in the specified path:

# ls -l /nix/store/k4n42ym3fsqg3mkfc2qnr4ivkkc17f4d-mib-library/opt/mib-library/REDDOXX-MIB
-r--r--r-- 1 root root 11220 Jan  1  1970 /nix/store/k4n42ym3fsqg3mkfc2qnr4ivkkc17f4d-mib-library/opt/mib-library/REDDOXX-MIB

So it's clearly there, has no extension and basename and module name also match. Here is the section in the configuration pointed out by the error message:

[[inputs.snmp.field]]
name = "SmtpReceiverConnectionsOut"
oid = "REDDOXX-MIB::SmtpReceiverConnectionsOut"

I also did an snmpget just to make sure I wasn't missing anything:

# snmpget -v 2c -c $rcom $rhost:161 -m  /nix/store/k4n42ym3fsqg3mkfc2qnr4ivkkc17f4d-mib-library/opt/mib-library/REDDOXX-MIB REDDOXX-MIB::SmtpReceiverConnectionsOut
REDDOXX-MIB::SmtpReceiverConnectionsOut = Counter32: 0

So clearly, it works. Now I am qute dumbfounded...

Do you have any idea what I can do? A collegue has recently ran into similiar issues with MIBs published by Zyxel - but they also are plagued with syntax errors... so that's another issue.

Still... Do you have an idea what is going on here?

Thanks and kind regards!

@Hipska
Copy link
Contributor

Hipska commented Jan 16, 2024

Hi can you test with latest 1.29 version and also let us know what value you set for snmp_translator in [agent] section for config in a new bug report please? You can link to this issue in the additional information section.

@senpro-ingwersenk
Copy link
Contributor

I will give it a try; upgrading nixos should give me the latest version. As for the parser, gosmi :)

@senpro-ingwersenk
Copy link
Contributor

...I will have to get back at this at a later point, I apologize.
https://discourse.nixos.org/t/upgrading-raspi3-from-23-05-23-11-says-cp-not-found/38333
(This is in fact the very same device.)

I did clone the gosmi source and see if it would load the MIB from the CLI (cmd/smi) and that actually worked:

mibs/dist$ ../../gosmi/gosmi -d -p ./ -m REDDOXX-MIB
Loaded module REDDOXX-MIB

So I have high hopes that upgrading Telegraf could fix this issue.

Do you have a temporary workaround though? Is there something I can do on 1.26 to at least hotfix the issue for the time being?

@senpro-ingwersenk
Copy link
Contributor

I was able to find a workaround! Long story short, extlinux generator, because u-boot was already in the boot partition.
Now; I rebuilt my OS and got to Telegraf 1.28.2 - and that one DOES load my MIB now!

It seems that 1.26 is one of the versions affected with the "regression". I didn't have time to sift through the commit history to find the exact point it was fixed, but I suspect that it was at the earliest 1.27.

Hopefuly this detail helps someone stumbling over this!

@senpro-ingwersenk
Copy link
Contributor

... Nevermind. It just never generated the config, and I missed that, because I had set my own option to false. Oof.

Well, the error is right back, even on 1.28.

Though I had to wonder - is it having issues with the Counter32 type? https://github.com/senpro-it/mibs/blob/main/dist/REDDOXX-MIB#L53-L58

The error Error running agent: could not initialize input inputs.snmp: initializing field SmtpReceiverConnectionsOut: translating: cannot make REDDOXX-MIB::SmtpReceiverConnectionsOut numeric, please ensure all imported mibs are in the path suggests also that it perhaps can not convert the Counter32 type? At first, I had understood it as not being able to find this particular entry in the MIB - but perhaps it doesn#t like the type outright?

I tried to google for that, but could not find a clear reference to which SNMP types are understood, potentially automatically converted, and which are not.

Do you have any pointer for that approach? Thanks!

senpro-ingwersenk added a commit to senpro-ingwersenk/telegraf that referenced this issue Jan 23, 2024
This addresses influxdata#14598 and influxdata#10444 
The previous error message was unclear, especially to newcommers to SNMP, SMI and MIBs. With this slight rephrasing, users may have a better clue as to what the issue might be and can start looking for issues approprietly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/snmp bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants