I'm trying to monitor some switches with mrtg (on Centos 6.7), everything is ok but I have some problem with the cron task.
Code: Select all
MRTG data has expired (xxx days old)Code: Select all
*/5 * * * * /usr/bin/env LANG=C /usr/bin/mrtg /etc/mrtg/mymrtg.cfg –logging /var/log/mrtg.log
*/5 * * * * /usr/bin/env LANG=C /usr/bin/mrtg /etc/httpd/conf/mrtg.cfg --logging /var/log/mrtg.logI got a lot of Mail in /var/spoon/mail/root:
Code: Select all
From: [email protected] (Cron Daemon)
To: [email protected]
Subject: Cron <root@nagioscorefx> /usr/bin/env LANG=C /usr/bin/mrtg /etc/mrtg/mymrtg.cfg –logging /var/log/mrtg.log
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env: <LANG=it_IT.UTF-8>
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: Thu, 5 May 2016 15:45:01 +0200 (CEST)
Use of uninitialized value $first in pattern match (m//) at /usr/bin/../lib64/mrtg2/MRTG_lib.pm line 611.
Use of uninitialized value $dir in concatenation (.) or string at /usr/bin/mrtg line 2531.
Use of uninitialized value $dir in concatenation (.) or string at /usr/bin/mrtg line 2549.
Use of uninitialized value $dir in concatenation (.) or string at /usr/bin/mrtg line 2565.
ERROR: "WorkDir" not specified in mrtg config file
From [email protected] Thu May 5 15:50:02 2016
Return-Path: <[email protected]>
X-Original-To: root
Delivered-To: [email protected]
Received: by nagioscorefx.finance.com (Postfix, from userid 0)
id 13A121014F7; Thu, 5 May 2016 15:50:02 +0200 (CEST)
From: [email protected] (Cron Daemon)
To: [email protected]
Subject: Cron <root@nagioscorefx> /usr/bin/env LANG=C /usr/bin/mrtg /etc/mrtg/mymrtg.cfg –logging /var/log/mrtg.log
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env: <LANG=it_IT.UTF-8>
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: Thu, 5 May 2016 15:50:02 +0200 (CEST)
Use of uninitialized value $first in pattern match (m//) at /usr/bin/../lib64/mrtg2/MRTG_lib.pm line 611.
Use of uninitialized value $dir in concatenation (.) or string at /usr/bin/mrtg line 2531.
Use of uninitialized value $dir in concatenation (.) or string at /usr/bin/mrtg line 2549.
Use of uninitialized value $dir in concatenation (.) or string at /usr/bin/mrtg line 2565.
ERROR: "WorkDir" not specified in mrtg config file
For "create" the mrgt configuration files I used:
Code: Select all
cfgmaker --global 'WorkDir: /var/www/html/mrtg' --global 'Options[_]: bits,growright' --output /etc/httpd/conf/mrtg.cfg [email protected]Thank you very much.