Nagios plugins - interfacetable_v3t issues

This forum is intended for the discussion of Nagios plugin development. Feature requests, patches, bug fixes, and all types of development-related discussions are welcome!

NOTE: The SourceForge.net nagiosplug-devel mailing list has been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Nagios plugins - interfacetable_v3t issues

Postby charpham » Tue Feb 13, 2018 7:56 pm

Hi

Has anybody used this plugin for Nagios Core 4.3.4 on CentOS 7? I am having some problems on how to use this.. The documentation in regards to the actual configuration setup for Nagios is virtually non existent. There is no mention as how to configure this in the cfg files.. I can run the command from CLI and get results but when adding it to my switch.cfg and command.cfg, I get errors when I reload nagios. I am not sure how this is done... here is a snippet of my command.cfg file

#checking router and switch interface info
define command{
command_name check_interface_table_v3t
command_line /usr/local/nagios/libexec/check_interface_table_v3t.pl -H $HOSTADDRESS$
}

here is a snippet of my switch.cfg file
# monitoring inteface stats using plugin - check_interface_v3t
define service{
use generic-service ; Inherit values from a template
host_name switch-1
service_description Interface status
check_command check_interface_table_v3t.pl -2 -C <string>-f

If i reload nagios i see the following error..
feb 13 16:52:17 nagios.server.net nagios[15074]: Error: Service check command 'check_interface_table_v3t.pl -2 -C <string> -f' specified in service 'Interface status' for host 'switch-1' not defined anywhere!

is there somewhere else that this needs to be defined...?

any help would be greatly appreciated..

thanks
charpham
 
Posts: 16
Joined: Fri Dec 22, 2017 2:59 pm

Re: Nagios plugins - interfacetable_v3t issues

Postby tgriep » Wed Feb 14, 2018 5:03 pm

If looks like your command is missing the $ARG1$ $ARG2$ in the command line, change you command line from
Code: Select all
/usr/local/nagios/libexec/check_interface_table_v3t.pl -H $HOSTADDRESS$

to
Code: Select all
/usr/local/nagios/libexec/check_interface_table_v3t.pl -H $HOSTADDRESS$ -C $ARG1$ $ARG2$


Then in your service check, put the community string in $ARG1$ and in $ARG2$ put the following
Code: Select all
-2 -f


Save the changes and restart nagios to see if the changes work.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
 
Posts: 6552
Joined: Thu Oct 30, 2014 9:02 am

Re: Nagios plugins - interfacetable_v3t issues

Postby charpham » Wed Feb 21, 2018 6:48 pm

Thanks so much ... I will give this a try and let you know of my results
charpham
 
Posts: 16
Joined: Fri Dec 22, 2017 2:59 pm

Re: Nagios plugins - interfacetable_v3t issues

Postby tmcdonald » Thu Feb 22, 2018 11:13 am

We'll keep this open for you
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tmcdonald
Operations Engineer
 
Posts: 8918
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios plugins - interfacetable_v3t issues

Postby charpham » Sun Mar 04, 2018 2:23 pm

Hi

Looks like I am still having problems

Here is what I did
I modified the device.cfg file
here is a snippet

# monitoring interface stats using plugin - check_interface_v3t
define service{
use generic-service ; Inherit values from a template
host_name charpham-3548
service_description Interface status
check_command check_interface_table_v3t.pl -H <hostaddress> -C v14tual -2 -f
}

Here is the snippet for commands.cfg

#checking router and switch interface info
define command{
command_name check_interface_table_v3t
command_line /usr/local/nagios/libexec/check_interface_table_v3t.pl -H $HOSTADDRESS$ -C $ARG1$ $ARG2$
}


I reloaded Nagios and checking the logs it still seems to fail

Error: Service check command 'check_interface_table_v3t.pl -H <hostaddress> -C <device community string> -2 -f' specified in service 'Interface status' for host 'hostname' not defined anywhere!
Mar 04 10:57:31 terminusnet nagios[24507]: Checked 40 services.
Mar 04 10:57:31 terminusnet nagios[24507]: Checked 8 hosts.


I also ran "./check_interface_table_v3t.pl -H 1<hostaddress>-C <community string> -2 -f" from the cli and did get output
charpham
 
Posts: 16
Joined: Fri Dec 22, 2017 2:59 pm

Re: Nagios plugins - interfacetable_v3t issues

Postby scottwilkerson » Mon Mar 05, 2018 2:42 pm

This plugin used a cache directory which I thin by default is /tmp/.ifCache

If you run the plugin a few times as root, it creates the files in needs WITHOUT access for nagios user.

Try this, run the following
Code: Select all
chown -R nagios.nagios /tmp/.ifCache


Then see if they work in the UI
http://www.tontonitch.com/tiki/tiki-index.php?page=Nagios+plugins+-+interfacetable_v3t+-+documentation+-+0.05+-+Plugin+usage&structure=Nagios+plugins+-+interfacetable_v3t+-+documentation+-+0.05

You can also change the directory with the --cachedir flag, but make sure the nagios user can read/write to the directory
User avatar
scottwilkerson
CTO
 
Posts: 8929
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Nagios plugins - interfacetable_v3t issues

Postby charpham » Sat Mar 17, 2018 3:03 pm

Thanks for the response... I will give this a try when I have a chance

much appreciated for your help
charpham
 
Posts: 16
Joined: Fri Dec 22, 2017 2:59 pm

Re: Nagios plugins - interfacetable_v3t issues

Postby tmcdonald » Mon Mar 19, 2018 10:26 am

We'll keep this thread open for you pending your reply.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tmcdonald
Operations Engineer
 
Posts: 8918
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios plugins - interfacetable_v3t issues

Postby charpham » Mon Mar 19, 2018 2:59 pm

Hi

I am just starting out regarding scripting.. Regard specifying the /tmp directory for .ifcache, do you know where this is specified. If it in the python script "check_interface_table_v3t.pl"? . What is the syntax for to change the "cachedir" Sorry for my ignorance here. LOL

In the "check_interface_table_v3t.pl" I did change the cachdir under
Code: Select all
# Default values: snmp options
    %ghSNMPOptions = (
        '.......
        'cachedir'                  => "/tmp/.ifCache",

I changed this to /usr/local/nagios/etc/ .ifcache as noted below... however I can't seem to change the ownership even though the directory/file ".ifCache" is there.. (as a hidden directory/file with permissions root.root)

Code: Select all
[root libexec]# chown -R nagios.nagios /tmp/.ifCache
chown: cannot access ‘/tmp/.ifCache’: No such file or directory
[root libexec]#

[root@terminus libexec]# ./check_interface_table_v3t.pl -D
\1 better written as $1 at /usr/local/interfacetable_v3t/lib/SnmpUtils.pm line 743.
\2 better written as $2 at /usr/local/interfacetable_v3t/lib/SnmpUtils.pm line 743.


.........

Snmp options:

Code: Select all
{
  '64bits' => 0,
  'authproto' => 'md5',
  'cachedir' => '/usr/local/nagios/etc/.ifCache',
  'community' => 'public',
  'contextname' => '',
  'domain' => 'udp',
  'host' => 'localhost',
  'login' => '',
  'max-repetitions' => undef,
  'maxmsgsize' => undef,
  'passwd' => '',
  'port' => 161,
  'privpass' => '',
  'privproto' => 'des',
  'retries' => 2,
  'timeout' => 2,
  'unixsnmp' => 0,
  'version' => '1'



If run the following I get this..
charpham
 
Posts: 16
Joined: Fri Dec 22, 2017 2:59 pm

Re: Nagios plugins - interfacetable_v3t issues

Postby kyang » Wed Mar 21, 2018 4:57 pm

I have never used this plugin before, but in regards to what scottwilkerson said,

your cachedir is located here--> /usr/local/nagios/etc/.ifCache

Run this to change ownership of the .ifCache.
Code: Select all
chown -R nagios.nagios /usr/local/nagios/etc/.ifCache


by scottwilkerson
You can also change the directory with the --cachedir flag, but make sure the nagios user can read/write to the directory

Looking at the --help options. If you use --cachedir <caching directory> --> that is how you can change the cachedir.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
kyang
Support Tech
 
Posts: 1636
Joined: Tue Jul 25, 2017 3:35 pm

Next

Return to Nagios Plugin Development

Who is online

Users browsing this forum: No registered users and 3 guests