2014R1.0RC1 Initial reaction and question(s)

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
b2m
Posts: 71
Joined: Tue Jun 11, 2013 9:18 am

Re: 2014R1.0RC1 Initial reaction and question(s)

Post by b2m »

With your modification in cfgmaker Nagios can finally read the interface data of the switch. Anyway, it cannot poll data from it.

I guess there has to be something else done with the scripts executing the checks?

It reads like that:

check_xi_service_mrtgtraf!192.168.120.253_10123.rrd!50000,50000!80000,80000!K

check_xi_service_ifoperstatusnag!10123!-v 3 -u manager -A xxx -X xxx -l authPriv
You do not have the required permissions to view the files attached to this post.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: 2014R1.0RC1 Initial reaction and question(s)

Post by slansing »

Bear in mind that it does take some time for those RRD's to populate, you might have to wait upwards of 30 minutes in extreme cases, before they have the necessary data to be formed. Was this the case? Are they working now? Has the error changed?
b2m
Posts: 71
Joined: Tue Jun 11, 2013 9:18 am

Re: 2014R1.0RC1 Initial reaction and question(s)

Post by b2m »

slansing wrote:Was this the case? Are they working now? Has the error changed?
No.

As you see, the interface state doesn't work eather.

This is written to root's mail:

Code: Select all

From: [email protected] (Cron Daemon)
To: [email protected]
Subject: Cron <root@localhost> LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>
Message-Id: <[email protected]>
Date: Sat, 26 Apr 2014 14:40:03 +0200 (CEST)

Use of uninitialized value $dir in concatenation (.) or string at /usr/bin/mrtg line 2658.
Use of uninitialized value $dir in concatenation (.) or string at /usr/bin/mrtg line 2676.
Use of uninitialized value $dir in concatenation (.) or string at /usr/bin/mrtg line 2692.
ERROR: "WorkDir" not specified in mrtg config file
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: 2014R1.0RC1 Initial reaction and question(s)

Post by slansing »

Looks like there is a problem with your mrtg.cfg file, what is the output of the following:

Code: Select all

cat /etc/mrtg/mrtg.cfg
b2m
Posts: 71
Joined: Tue Jun 11, 2013 9:18 am

Re: 2014R1.0RC1 Initial reaction and question(s)

Post by b2m »

mrtg.conf starts like this:

Code: Select all

#### ADDED BY NAGIOSXI (USER: nagiosadmin, DATE: 2014-04-26 14:19:53) ####
# Created by
# /usr/bin/cfgmaker --show-op-down --noreversedns --zero-speed 100000000 --enablesnmpv3 --snmp-options=:::::3 --username=manager --authprotocol=sha --authpassword=df3Uvo0QfaA1pP3n --privprotocol=aescfb128 --privpassword=1qv6hJ3C9Q1bvzR8 --contextengineid=0 192.168.120.253


### Global Config Options

#  for UNIX
# WorkDir: /home/http/mrtg

#  or for NT
# WorkDir: c:\mrtgdata

### Global Defaults

#  to get bits instead of bytes and graphs growing to the right
# Options[_]: growright, bits

EnableIPv6: no
I didn't change anything here. What about the state check? This is done via normal SNMP queries, right? What can be the problem here?
Last edited by b2m on Tue Apr 29, 2014 11:26 pm, edited 1 time in total.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: 2014R1.0RC1 Initial reaction and question(s)

Post by sreinhardt »

The error that slansing was noticing is specific to mrtg configuration, not the checks or snmpgets themselves. Could you post the lines that the errors are referencing?

Code: Select all

Use of uninitialized value $dir in concatenation (.) or string at /usr/bin/mrtg line 2658.
Use of uninitialized value $dir in concatenation (.) or string at /usr/bin/mrtg line 2676.
Use of uninitialized value $dir in concatenation (.) or string at /usr/bin/mrtg line 2692.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
b2m
Posts: 71
Joined: Tue Jun 11, 2013 9:18 am

Re: 2014R1.0RC1 Initial reaction and question(s)

Post by b2m »

line 2568

Code: Select all

 if ( ! -r "$dir${main::SL}mrtg-l.png" and  open W, ">$dir${main::SL}mrtg-l.png" ){
line 2676

Code: Select all

if ( ! -r "$dir${main::SL}mrtg-m.png" and  open W, ">$dir${main::SL}mrtg-m.png" ){
line 2692

Code: Select all

if ( ! -r "$dir${main::SL}mrtg-r.png" and  open W, ">$dir${main::SL}mrtg-r.png" ){
Is $dir the variable for the work dir? How does a well-functioning mrtg.conf look like?
sreinhardt wrote:The error that slansing was noticing is specific to mrtg configuration, not the checks or snmpgets themselves
I know but the check of interface state doesn't work, either.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: 2014R1.0RC1 Initial reaction and question(s)

Post by tmcdonald »

Does your mrtg.cfg file have a "Include:" line in it? If not you will need to specify the "WorkDir:" directive. Mine says "WorkDior: /var/lib/mrtg". Looking at the source code this is one of three places where the $dir variable can be pulled from.
Former Nagios employee
b2m
Posts: 71
Joined: Tue Jun 11, 2013 9:18 am

Re: 2014R1.0RC1 Initial reaction and question(s)

Post by b2m »

It works after I
a) upgraded to RC3
b) deleted everything related
c) ran the monitoring wizard again
d) added the following to mrtg.cfg which I got from mrtg.cfg.orig:

Code: Select all

HtmlDir: /var/www/mrtg
ImageDir: /var/www/mrtg
LogFormat: rrdtool
LogDir: /var/lib/mrtg
ThreshDir: /var/lib/mrtg
WorkDir: /var/lib/mrtg
Would you please tell me whether this is a general error that cfgmaker doesn't include the directories or if it's just on my system.

The second problem with the interface state checks. The wizards creates the following call of check_ifoperstatnag:

Code: Select all

[root@localhost libexec]# ./check_ifoperstatnag 10124 192.168.120.126 -v 3 -u manager -A xxx -X xxx -l authPriv
No log handling enabled - turning on stderr logging
snmpwalk: Authentication failure (incorrect password, community or key) (Sub-id not found: (top) -> ifOperStatus)
./check_ifoperstatnag: line 18: [: -eq: unary operator expected
./check_ifoperstatnag: line 21: [: -eq: unary operator expected
WARNING - No info is being retrieved
The check_ifoperstatnag plugin on my system looks like this:

Code: Select all

#!/bin/sh
#
# Check ifoperstatus() without calling the perl routine, this script uses
# snmpwalk to get the info.
#
# $1: Community string ; $2 Target address ; $3 Target interface
#
# by nAAs <[email protected]>

LIBEXEC=$(dirname $0)
. $LIBEXEC/utils.sh

iface=$1
shift

comm=$(snmpwalk $@ ifOperStatus.$iface | awk -F: '{print $4}' | awk -F\( '{print $2}' | awk -F\) '{print $1}')

if [ $comm -eq 1 ]; then
        echo "OK - Interface $iface is up."
        exit $STATE_OK
        elif [ $comm -eq 2 ]; then
                echo "CRITICAL - Interface $iface is down"
                exit $STATE_CRITICAL
        else
                echo "WARNING - No info is being retrieved"
                exit $STATE_WARNING
fi
As you see it looks like there is no SNMPv3 functionality implemented. Do I have an old version of this script or what is my problem here?

Thanks.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: 2014R1.0RC1 Initial reaction and question(s)

Post by scottwilkerson »

Actually, I believe there may be a bug in the command definition

Can you run the following?

Code: Select all

./check_ifoperstatnag 10124 -v 3 -u manager -A xxx -X xxx -l authPriv 192.168.120.126
either way, we will be testing this internally and get it sorted BEFORE the full 2014 Release
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked