Wizard "Network Switch / Router" - check_xi_service_mrtgtraf

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: Wizard "Network Switch / Router" - check_xi_service_mrtg

Post by nscott »

GldRush,

Adding that WorkDir would only affect it if it were applied before the switch was created. What you'll need to do is create those RRDs manually.

You can do that using the touch command (I'm guessing on the RRD file names)

touch /var/lib/mrtg/10.3.1.101_{1..24}.rrd

That should create those RRDs. You'll need to wait 10 minutes before they begin filling with data. If MRTG still isn't writing to them then we'll need to rrdtool create them, lets see if the touch fixes the problem.
Nicholas Scott
Former Nagios employee
User avatar
GldRush98
Posts: 256
Joined: Wed May 25, 2011 10:51 am
Location: Springfield, IL

Re: Wizard "Network Switch / Router" - check_xi_service_mrtg

Post by GldRush98 »

nscott wrote:GldRush,

Adding that WorkDir would only affect it if it were applied before the switch was created. What you'll need to do is create those RRDs manually.

You can do that using the touch command (I'm guessing on the RRD file names)

touch /var/lib/mrtg/10.3.1.101_{1..24}.rrd

That should create those RRDs. You'll need to wait 10 minutes before they begin filling with data. If MRTG still isn't writing to them then we'll need to rrdtool create them, lets see if the touch fixes the problem.
I touched the rrd files to create them, but something still doesn't seem to be right, as it's not showing the bandwidth on the ports at all, and the .rrd files themselves are empty...
Just a small sample of the ones I touched...
-rw-r--r-- 1 root root 0 Jun 27 11:19 10.3.1.253_44.rrd
-rw-r--r-- 1 root root 0 Jun 27 11:19 10.3.1.253_45.rrd
-rw-r--r-- 1 root root 0 Jun 27 11:19 10.3.1.253_46.rrd
-rw-r--r-- 1 root root 0 Jun 27 11:19 10.3.1.253_47.rrd
-rw-r--r-- 1 root root 0 Jun 27 11:19 10.3.1.253_48.rrd
-rw-r--r-- 1 root root 0 Jun 27 11:19 10.3.1.253_49.rrd
-rw-r--r-- 1 root root 0 Jun 27 11:19 10.3.1.253_4.rrd
-rw-r--r-- 1 root root 0 Jun 27 11:19 10.3.1.253_50.rrd
-rw-r--r-- 1 root root 0 Jun 27 11:19 10.3.1.253_51.rrd
-rw-r--r-- 1 root root 0 Jun 27 11:19 10.3.1.253_52.rrd
-rw-r--r-- 1 root root 0 Jun 27 11:19 10.3.1.253_53.rrd
-rw-r--r-- 1 root root 0 Jun 27 11:19 10.3.1.253_54.rrd
-rw-r--r-- 1 root root 0 Jun 27 11:19 10.3.1.253_55.rrd
-rw-r--r-- 1 root root 0 Jun 27 11:19 10.3.1.253_56.rrd
(as you can see, file size is still 0)

But I do have some other rrd files for the 10.3.1.253 Core that seem to have data in them:
-rw-r--r-- 1 root root 105164 Jun 27 12:35 10.3.1.253_75497609.rrd
-rw-r--r-- 1 root root 105164 Jun 27 12:35 10.3.1.253_75497617.rrd
-rw-r--r-- 1 root root 105164 Jun 27 12:35 10.3.1.253_75497625.rrd
-rw-r--r-- 1 root root 105164 Jun 27 12:35 10.3.1.253_75497633.rrd
-rw-r--r-- 1 root root 105164 Jun 27 12:35 10.3.1.253_75497641.rrd
-rw-r--r-- 1 root root 105164 Jun 27 12:35 10.3.1.253_75497649.rrd
-rw-r--r-- 1 root root 105164 Jun 27 12:35 10.3.1.253_75497657.rrd
-rw-r--r-- 1 root root 105164 Jun 27 12:35 10.3.1.253_75497665.rrd
-rw-r--r-- 1 root root 105164 Jun 27 12:35 10.3.1.253_75497673.rrd
-rw-r--r-- 1 root root 105164 Jun 27 12:35 10.3.1.253_75497681.rrd
-rw-r--r-- 1 root root 105164 Jun 27 12:35 10.3.1.253_75497689.rrd
-rw-r--r-- 1 root root 105164 Jun 27 12:35 10.3.1.253_75497697.rrd
-rw-r--r-- 1 root root 105164 Jun 27 12:35 10.3.1.253_75497705.rrd
-rw-r--r-- 1 root root 105164 Jun 27 12:35 10.3.1.253_75497713.rrd
-rw-r--r-- 1 root root 105164 Jun 27 12:35 10.3.1.253_75497721.rrd
but these file names (the part after the underscore) don't match what Nagios was looking for...?
I don't know what is going on really. It seems like Nagios was expecting one file name, when the file is actually being named something different.
Dev & Prod XI: Debian 12 - Nagios XI 2024R1.3
User avatar
GldRush98
Posts: 256
Joined: Wed May 25, 2011 10:51 am
Location: Springfield, IL

Re: Wizard "Network Switch / Router" - check_xi_service_mrtg

Post by GldRush98 »

Just tried removing/adding the switch again. Same problems.
Noticed the mail log spewed a bunch of messages...

Code: Select all

2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497486][_IN_] ' $target->[1646]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497486][_OUT_] ' $target->[1646]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497497][_IN_] ' $target->[1647]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497497][_OUT_] ' $target->[1647]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497505][_IN_] ' $target->[1648]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497505][_OUT_] ' $target->[1648]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497513][_IN_] ' $target->[1649]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497513][_OUT_] ' $target->[1649]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497521][_IN_] ' $target->[1650]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497521][_OUT_] ' $target->[1650]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497529][_IN_] ' $target->[1651]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497529][_OUT_] ' $target->[1651]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497537][_IN_] ' $target->[1652]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497537][_OUT_] ' $target->[1652]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497545][_IN_] ' $target->[1653]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497545][_OUT_] ' $target->[1653]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497553][_IN_] ' $target->[1654]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497553][_OUT_] ' $target->[1654]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497561][_IN_] ' $target->[1655]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497561][_OUT_] ' $target->[1655]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497569][_IN_] ' $target->[1656]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497569][_OUT_] ' $target->[1656]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497577][_IN_] ' $target->[1657]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497577][_OUT_] ' $target->[1657]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497585][_IN_] ' $target->[1658]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497585][_OUT_] ' $target->[1658]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497593][_IN_] ' $target->[1659]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497593][_OUT_] ' $target->[1659]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497601][_IN_] ' $target->[1660]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497601][_OUT_] ' $target->[1660]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497609][_IN_] ' $target->[1661]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497609][_OUT_] ' $target->[1661]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497617][_IN_] ' $target->[1662]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497617][_OUT_] ' $target->[1662]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497625][_IN_] ' $target->[1663]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497625][_OUT_] ' $target->[1663]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497633][_IN_] ' $target->[1664]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497633][_OUT_] ' $target->[1664]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497641][_IN_] ' $target->[1665]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497641][_OUT_] ' $target->[1665]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497649][_IN_] ' $target->[1666]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497649][_OUT_] ' $target->[1666]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497657][_IN_] ' $target->[1667]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497657][_OUT_] ' $target->[1667]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497665][_IN_] ' $target->[1668]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497665][_OUT_] ' $target->[1668]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497673][_IN_] ' $target->[1669]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497673][_OUT_] ' $target->[1669]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497681][_IN_] ' $target->[1670]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497681][_OUT_] ' $target->[1670]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497689][_IN_] ' $target->[1671]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497689][_OUT_] ' $target->[1671]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497697][_IN_] ' $target->[1672]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497697][_OUT_] ' $target->[1672]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497705][_IN_] ' $target->[1673]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497705][_OUT_] ' $target->[1673]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497713][_IN_] ' $target->[1674]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497713][_OUT_] ' $target->[1674]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497721][_IN_] ' $target->[1675]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497721][_OUT_] ' $target->[1675]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497729][_IN_] ' $target->[1676]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497729][_OUT_] ' $target->[1676]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497737][_IN_] ' $target->[1677]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497737][_OUT_] ' $target->[1677]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497745][_IN_] ' $target->[1678]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497745][_OUT_] ' $target->[1678]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497753][_IN_] ' $target->[1679]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497753][_OUT_] ' $target->[1679]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497761][_IN_] ' $target->[1680]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497761][_OUT_] ' $target->[1680]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497769][_IN_] ' $target->[1681]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497769][_OUT_] ' $target->[1681]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497777][_IN_] ' $target->[1682]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497777][_OUT_] ' $target->[1682]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497785][_IN_] ' $target->[1683]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497785][_OUT_] ' $target->[1683]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497793][_IN_] ' $target->[1684]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497793][_OUT_] ' $target->[1684]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497801][_IN_] ' $target->[1685]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497801][_OUT_] ' $target->[1685]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497809][_IN_] ' $target->[1686]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497809][_OUT_] ' $target->[1686]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497817][_IN_] ' $target->[1687]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497817][_OUT_] ' $target->[1687]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497825][_IN_] ' $target->[1688]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497825][_OUT_] ' $target->[1688]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497833][_IN_] ' $target->[1689]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497833][_OUT_] ' $target->[1689]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497841][_IN_] ' $target->[1690]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497841][_OUT_] ' $target->[1690]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497849][_IN_] ' $target->[1691]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497849][_OUT_] ' $target->[1691]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497857][_IN_] ' $target->[1692]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497857][_OUT_] ' $target->[1692]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497865][_IN_] ' $target->[1693]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497865][_OUT_] ' $target->[1693]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497873][_IN_] ' $target->[1694]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497873][_OUT_] ' $target->[1694]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497913][_IN_] ' $target->[1695]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497913][_OUT_] ' $target->[1695]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497921][_IN_] ' $target->[1696]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497921][_OUT_] ' $target->[1696]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497929][_IN_] ' $target->[1697]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497929][_OUT_] ' $target->[1697]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497937][_IN_] ' $target->[1698]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497937][_OUT_] ' $target->[1698]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497945][_IN_] ' $target->[1699]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497945][_OUT_] ' $target->[1699]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497953][_IN_] ' $target->[1700]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497953][_OUT_] ' $target->[1700]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497961][_IN_] ' $target->[1701]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497961][_OUT_] ' $target->[1701]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497969][_IN_] ' $target->[1702]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497969][_OUT_] ' $target->[1702]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75498298][_IN_] ' $target->[1703]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75498298][_OUT_] ' $target->[1703]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75498306][_IN_] ' $target->[1704]{$mode} ' did not eval into defined data
2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75498306][_OUT_] ' $target->[1704]{$mode} ' did not eval into defined data
Dev & Prod XI: Debian 12 - Nagios XI 2024R1.3
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: Wizard "Network Switch / Router" - check_xi_service_mrtg

Post by nscott »

GldRush,

Can you verify that RRDs.pm is installed?

Code: Select all

perl -MRRDs -le 'print q(ok!)'
Are you attempting to re-add switches that had previously been added previously? MRTG might be interpreting those as new switches. I'm not sure how familiar you are with MRTG. but try removing the configuration of the switch in /etc/mrtg/mrtg.cfg. DO NOT delete the whole file, just the lines that are relevant to the switch you're re-adding.
Nicholas Scott
Former Nagios employee
User avatar
GldRush98
Posts: 256
Joined: Wed May 25, 2011 10:51 am
Location: Springfield, IL

Re: Wizard "Network Switch / Router" - check_xi_service_mrtg

Post by GldRush98 »

nscott wrote:GldRush,

Can you verify that RRDs.pm is installed?

Code: Select all

perl -MRRDs -le 'print q(ok!)'
Are you attempting to re-add switches that had previously been added previously? MRTG might be interpreting those as new switches. I'm not sure how familiar you are with MRTG. but try removing the configuration of the switch in /etc/mrtg/mrtg.cfg. DO NOT delete the whole file, just the lines that are relevant to the switch you're re-adding.
[root@localhost ~]# perl -MRRDs -le 'print q(ok!)'
ok!
[root@localhost ~]#
I will have a look through the mrtg.cfg file. My apologies if this issue is not related to the OP's. I thought it might be, which is why I posted it in this thread instead of a new one.

Edit: Just a quick grep on that file shows a bunch of references to the switch I'm trying to add. How should I go about cleaning this file up? Is there any way to re-generate it or am I looking at a manual cleanup?
Dev & Prod XI: Debian 12 - Nagios XI 2024R1.3
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: Wizard "Network Switch / Router" - check_xi_service_mrtg

Post by nscott »

I will have a look through the mrtg.cfg file. My apologies if this issue is not related to the OP's. I thought it might be, which is why I posted it in this thread instead of a new one.
Don't worry about, its the same vein and it makes sense you posted it under here. :)
Just a quick grep on that file shows a bunch of references to the switch I'm trying to add. How should I go about cleaning this file up? Is there any way to re-generate it or am I looking at a manual cleanup?
Unfortunately there is not. They all dump to the main mrtg.cfg.

Edit: I was able to duplicate your exact error log in the mail file. Working on it now.
Nicholas Scott
Former Nagios employee
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: Wizard "Network Switch / Router" - check_xi_service_mrtg

Post by nscott »

Alright,

I was getting this exact same error:

Code: Select all

2011-06-27 13:45:42: ERROR: Target[10.3.1.253_75497486][_IN_] ' $target->[1646]{$mode} ' did not eval into defined data
Albeit, it was different numbers. I deleted the switch config from the mrtg.cfg. Added the line

WorkDir: /var/lib/mrtg

to the global commands. Then I removed the switches from Nagios and re-added them. The services initially came up as "RRDs not found" but MRTG created them about 10 minutes later and the data being written seems correct.
Nicholas Scott
Former Nagios employee
User avatar
GldRush98
Posts: 256
Joined: Wed May 25, 2011 10:51 am
Location: Springfield, IL

Re: Wizard "Network Switch / Router" - check_xi_service_mrtg

Post by GldRush98 »

Yup, the key was cleaning up the old switch out of the mrtg.cfg file.

I cleaned up the mrtg.cfg file, which actually turned out to be easier than I thought it would be once I delved in to it.

I then re-added the switch, and everything seems to be working like it should! :mrgreen:
The rrd files were generated automatically, and they are logging traffic as they should.
So it looks like some clutter in the mrtg.cfg file was the root cause of my particular problem.

To anyone else having this problem, basically I removed the switch and its services via the core manager, then I edited the mrtg.cfg file (made a backup first!) and removed the config sections for the errant switch (the file actually isn't too bad to understand, just look through it and it should be fairly obvious where the sections are for each switch). Then I re-added the switch after editing the file and everything worked as it should.

This switch was added in before as another switch (we replaced our Core over the weekend) and as such as I was just wanting to delete the old switch and its data out and re-add the new switch in to get the status and bandwidth counters working for all the ports on the new Core switch.

Thanks again for your assistance Nicholas.

Not sure if this is a problem with the 2011R1.5 (I updated this morning before I had made any changes in Nagios), or what, but a heads up for others...
Dev & Prod XI: Debian 12 - Nagios XI 2024R1.3
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: Wizard "Network Switch / Router" - check_xi_service_mrtg

Post by nscott »

Awesome glad to hear it GldRush, thanks for posting your results.
Nicholas Scott
Former Nagios employee
User avatar
srrhd
Posts: 131
Joined: Thu May 19, 2011 6:15 am

Re: Wizard "Network Switch / Router" - check_xi_service_mrtg

Post by srrhd »

I modified /etc/mrtg/mrtg.cfg to add under the ThreshDir line "WorkDir: /var/lib/mrtg".

Then i add a new host in v2c... I know i am kind of stubborn sometimes, but honestly it was unintentionnally. And it's works !! Sometimes mistakes brings good news ! Nothing appears in /var/mail/root and the the rrd files get filled with data.

Could you just explain me the reason of all this ? Why changing (or forcing) the WorkDir gets everything working ?

Aurelien.
Configuration:
Nagios XI 2014R2.5
manually upgraded on 64bits CentOS 6
with nothing extra, no gnome, no proxy, no SSL
Add-ons: Hypermap, Minemap, Ping Action, Traceroute Action, Network Replay, graph Explorer, Latest Alert