Nagios plugins - interfacetable_v3t issues
Nagios plugins - interfacetable_v3t issues
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
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
Re: Nagios plugins - interfacetable_v3t issues
If looks like your command is missing the $ARG1$ $ARG2$ in the command line, change you command line from
to
Then in your service check, put the community string in $ARG1$ and in $ARG2$ put the following
Save the changes and restart nagios to see if the changes work.
Code: Select all
/usr/local/nagios/libexec/check_interface_table_v3t.pl -H $HOSTADDRESS$
Code: Select all
/usr/local/nagios/libexec/check_interface_table_v3t.pl -H $HOSTADDRESS$ -C $ARG1$ $ARG2$
Code: Select all
-2 -f
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Nagios plugins - interfacetable_v3t issues
Thanks so much ... I will give this a try and let you know of my results
Re: Nagios plugins - interfacetable_v3t issues
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
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
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nagios plugins - interfacetable_v3t issues
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
Then see if they work in the UI
http://www.tontonitch.com/tiki/tiki-ind ... ion+-+0.05
You can also change the directory with the --cachedir flag, but make sure the nagios user can read/write to the directory
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
http://www.tontonitch.com/tiki/tiki-ind ... ion+-+0.05
You can also change the directory with the --cachedir flag, but make sure the nagios user can read/write to the directory
Re: Nagios plugins - interfacetable_v3t issues
Thanks for the response... I will give this a try when I have a chance
much appreciated for your help
much appreciated for your help
Re: Nagios plugins - interfacetable_v3t issues
We'll keep this thread open for you pending your reply.
Former Nagios employee
Re: Nagios plugins - interfacetable_v3t issues
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
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)
.........
Snmp options:
If run the following I get this..
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",
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..
Re: Nagios plugins - interfacetable_v3t issues
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.
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
Looking at the --help options. If you use --cachedir <caching directory> --> that is how you can change the cachedir.by scottwilkerson
You can also change the directory with the --cachedir flag, but make sure the nagios user can read/write to the directory