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

snmp-process -1 not working #7782

Closed
slalomsk8er opened this issue Jan 27, 2020 · 3 comments
Closed

snmp-process -1 not working #7782

slalomsk8er opened this issue Jan 27, 2020 · 3 comments
Labels
area/itl Template Library CheckCommands wontfix Deprecated, not supported or not worth any effort

Comments

@slalomsk8er
Copy link
Contributor

Describe the bug

I try to monitor a transient process.

  vars.snmp_process[ "x" ] = {
    display_name = "x"
    snmp_process_name = "x"
    snmp_crit = "-1,3"
    snmp_warn = "-1,2"
    snmp_process_mem_usage = true
    snmp_process_cpu_usage = true
    notes = ""
  }

And get the following error:

Plugin Output
Unknown option: 1
Unknown option: ,
Unknown option: 3
Unknown option: 1
Unknown option: ,
Use of uninitialized value $num in pattern match (m//) at /usr/lib/nagios/plugins/check_snmp_process.pl line 93.
Numerical values for warning and critical
Usage: /usr/lib/nagios/plugins/check_snmp_process.pl [-v] -H <host> -C <snmp_community> [-2]

This is caused by '-c' '-1,3' '-w' '-1,2'.
The correct form as stated by check_snmp_process.pl -h should be '-c-1,3' '-w-1,2' and works on the command line. It would be great if the ITL could catch this.

To Reproduce

Try to ignore missing process as documented at http://nagios.manubulon.com/snmp_process.html and check_snmp_process.pl -h - see config sniped above.

Your Environment

  • Version used (icinga2 --version): 2.11.2-1.stretch from http://packages.icinga.org/debian icinga-stretch/main amd64 Packages
  • Operating System and version: Debian GNU/Linux 9 (stretch)
  • Version of check plugin apt show nagios-snmp-plugins:
apt show nagios-snmp-plugins
Package: nagios-snmp-plugins
Version: 2.0.0-1
Priority: optional
Section: net
Maintainer: Debian Nagios Maintainer Group <[email protected]>
Installed-Size: 626 kB
Depends: libnet-snmp-perl, monitoring-plugins-common | nagios-plugins-basic (>= 1.4.5-2), perl-base (>= 5.8.4-8), ucf, perl:any
Recommends: libcrypt-des-perl, libcrypt-rijndael-perl
Homepage: http://www.manubulon.com/nagios/index_snmp.html
Tag: admin::monitoring, implemented-in::perl, protocol::snmp, role::plugin,
 role::program, use::monitor, works-with::network-traffic
Download-Size: 75.0 kB
APT-Manual-Installed: yes
APT-Sources: http://ftp.ch.debian.org/debian stretch/main amd64 Packages
Description: SNMP Plugins for nagios
 A set of Nagios plugins to check hosts/devices using snmp protocol
 .
 The general idea of these scripts is to check as many things as possible with
 snmp (how do you install NRPE on Cisco or AS/400 ?) : disks, memory, load,
 interface, running procsses, etc...
 .
 The other idea is to select disks, interfaces, process using regular
 expressions

N: There is 1 additional record. Please use the '-a' switch to see it```
@dnsmichi
Copy link
Contributor

That's not possible with the way we escape shell arguments. Omitting the space between argument opts is somehow not within the spec for parsing command arguments.

In order to solve this, you'd have to create your own CheckCommand and only use the command array without arguments.

  command = [ PluginDir + "/check_snmp_process.pl", "-w$snmp_warn$", "-c$snmp_crit$", ... ]

Not sure if that works though. Best is to ask on the community forums on how others solve that. For the ITL, we don't aim to fix this special behavior.

@dnsmichi dnsmichi added area/itl Template Library CheckCommands wontfix Deprecated, not supported or not worth any effort labels Jan 29, 2020
@slalomsk8er
Copy link
Contributor Author

I "fixed" the problem for my installation after finding this: SteScho/manubulon-snmp#24 (comment)

It would be great if the Icinga team could bring this up with the manubulon developers.

I just had a look at the source forge page and it looks like it's dead and your GitHub repository is the second hit on DuckDuckGo. Are you the maintainer and willing to fix this problem in the plugin if not in the ITL?

The -1 attribute is useful to monitor resource usage of transient processes. In our case there is a service that starts 2 processes periodically for imports, that could to crazy.

@dnsmichi
Copy link
Contributor

I'm not actively maintaining this project anymore as stated in its README - mainly due to time and resource issues, I cannot do everything. You can always bring this up at my repo, create issues, pull requests and even become a maintainer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/itl Template Library CheckCommands wontfix Deprecated, not supported or not worth any effort
Projects
None yet
Development

No branches or pull requests

2 participants