Check NIC Status.

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Uday Kumar
Posts: 32
Joined: Wed May 11, 2016 11:59 pm

Check NIC Status.

Post by Uday Kumar »

Hi Team,
we are facing below error while trying to check NIC status by using check_nics.pl


Description : CRITICAL - Benchmark key Link detected does not exist in the ethtool report for eth0, change the script /usr/local/nagios/libexec/check_nics.pl accordingly.

For few days its working fine but suddenly it started throwing the above error, Can you please help us to sort out the error.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Check NIC Status.

Post by Box293 »

Can you please show us where you downloaded this plugin from, or upload it here.

Can you show us an example of executing the plugin at the command line along with the output it produces.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Uday Kumar
Posts: 32
Joined: Wed May 11, 2016 11:59 pm

Re: Check NIC Status.

Post by Uday Kumar »

Hi,

Please find the below output from terminal and also the attached check.(Same check is used for both below servers)

Using below service for calling

define service {
use dba-service
host_name 1234
service_description Check NIC status
check_command check_nrpe!racnsw1-rh1!check_nics
}


From a working server:
[root@123 libexec]# ./check_nics.pl
OK - ALL NICs are working fine.
NIC eth0:1000Mb/s,Full,Auto-negotiation is on.

From a non working server:

[root@12354 libexec]# ./check_nics.pl

CRITICAL - Benchmark key Link detected does not exist in the ethtool report for eth0, change the script ./check_nics.pl accordingly.
Benchmark key Link detected does not exist in the ethtool report for eth1, change the script ./check_nics.pl accordingly.
Benchmark key Link detected does not exist in the ethtool report for eth3, change the script ./check_nics.pl accordingly.
Attachments
check_nics.pl
(4.03 KiB) Downloaded 302 times
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Check NIC Status.

Post by lmiltchev »

Can you run the following commands on the "non working" server, and show the output?

Code: Select all

which ethtool
ip addr
grep ethtool /etc/sudoers
Be sure to check out our Knowledgebase for helpful articles and solutions!
Uday Kumar
Posts: 32
Joined: Wed May 11, 2016 11:59 pm

Re: Check NIC Status.

Post by Uday Kumar »

Hi,

Please find the below out puts from non working server.

[root@racnsw3-rh1 ~]# which ethtool
/sbin/ethtool

[root@racnsw3-rh1 ~]# ip addr
1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: bond0: <BROADCAST,MULTICAST,MASTER,UP> mtu 1500 qdisc noqueue
    link/ether 00:1a:4b:07:06:45 brd ff:ff:ff:ff:ff:ff
    inet 192.168.76.41/29 brd 192.168.76.47 scope global bond0
    inet6 fe80::200:ff:fe00:0/64 scope link
       valid_lft forever preferred_lft forever
3: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:1a:4b:07:06:44 brd ff:ff:ff:ff:ff:ff
    inet 172.16.130.235/24 brd 172.16.130.255 scope global eth0
    inet 172.16.130.237/24 brd 172.16.130.255 scope global secondary eth0:1
    inet6 fe80::21a:4bff:fe07:644/64 scope link
       valid_lft forever preferred_lft forever
4: eth1: <BROADCAST,MULTICAST,SLAVE,UP> mtu 1500 qdisc pfifo_fast master bond0 qlen 1000
    link/ether 00:1a:4b:07:06:45 brd ff:ff:ff:ff:ff:ff
5: eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
    link/ether 00:1a:4b:08:64:e4 brd ff:ff:ff:ff:ff:ff
6: eth3: <BROADCAST,MULTICAST,SLAVE,UP> mtu 1500 qdisc pfifo_fast master bond0 qlen 1000
    link/ether 00:1a:4b:07:06:45 brd ff:ff:ff:ff:ff:ff
7: sit0: <NOARP> mtu 1480 qdisc noop
    link/sit 0.0.0.0 brd 0.0.0.0

[root@racnsw3-rh1 ~]# grep ethtool /etc/sudoers
#Wallace added ethtool for Nagios account
nagios  ALL=(ALL) NOPASSWD:/sbin/ethtool
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Check NIC Status.

Post by tgriep »

Can you login to the remote server, run the following commands and post the output?

Code: Select all

chage -l nagios
ethtool eth0
su nagios
ethtool eth0
Thanks
Be sure to check out our Knowledgebase for helpful articles and solutions!
Uday Kumar
Posts: 32
Joined: Wed May 11, 2016 11:59 pm

Re: Check NIC Status.

Post by Uday Kumar »

Hi ,

[root@racnsw3-rh1 ~]# chage -l nagios
chage: unknown user: nagios

[root@racnsw3-rh1 ~]# ethtool eth0
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: umbg
Wake-on: g
Current message level: 0x00000007 (7)
Link detected: yes

[root@racnsw3-rh1 ~]# su nagios
su: user nagios does not exist
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Check NIC Status.

Post by tgriep »

It looks like the nagios user didn't get created on that server.
Can you login to that server as root, run the following commands to create the nagios user and groups?

Code: Select all

useradd nagios
groupadd nagios
groupadd nagcmd
usermod -a -G nagcmd nagios
usermod -a -G nagios nagios
After that is done, run the following to see if the nagios account can run the ethtool command and the check itself.

Code: Select all

su nagios
ethtool eth0
./check_nics.pl
If the above passes, check to see if Nagios Core is working now and let us know if it does.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Uday Kumar
Posts: 32
Joined: Wed May 11, 2016 11:59 pm

Re: Check NIC Status.

Post by Uday Kumar »

Hi Team,

Thanks a lot, Much appreciated.
Its working fine now.
Locked