RRD files not created for Get Script Data (Indexed) sources

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Moderators, Developers

Post Reply
Author
Message
ntrazivuk
Posts: 6
Joined: Thu Nov 07, 2019 6:49 am

RRD files not created for Get Script Data (Indexed) sources

#1 Post by ntrazivuk » Thu Dec 26, 2019 10:09 am

Hello,

a while ago I tried to set up monitoring of 40G/100G interface optical powers (which contain 4 lanes, hence 4 outputs in one query for Rx) using GET SNMP data (Indexed) method. It didn't work as posted here ( viewtopic.php?f=21&t=60284&p=280220#p280220 ).
Now I ve created a (very basic) python script to do this , but I have a problem that the RRD files are not being created. I dont think this is permissions issue, because all other graphs using Get SNMP data (Indexed) method work and RRD files are created for them.

Here is the output of my verbose query:
#####################################
Total: 0.000000, Delta: 0.000000, Found data query XML file at '/var/www/html/cacti/resource/script_queries/40G_test.xml'
Total: 0.000000, Delta: 0.000000, Running Data Query [24].
Total: 0.000000, Delta: 0.000000, Found Type = '4' [Script Query].
Total: 0.000000, Delta: 0.000000, XML file parsed ok.
Total: 1.910000, Delta: 1.900000, Executing script for num of indexes '/usr/bin/python3 /var/www/html/cacti/scripts/40G_test.py 'ip address omitted' 'num_indexes''
Total: 1.910000, Delta: 0.000000, Found number of indexes: 12
Total: 2.570000, Delta: 0.670000, Executing script for list of indexes '/usr/bin/python3 /var/www/html/cacti/scripts/40G_test.py 'ip address omitted' 'index'', Index Count: 12

Click to show Data Query output for 'index'
Found index: 16847105
Found index: 16847106
Found index: 16847361
Found index: 16847362
Found index: 17174785
Found index: 17174786
Found index: 17175041
Found index: 17175042
Found index: 17240321
Found index: 17240322
Found index: 17240577
Found index: 17240578

Click to show Data Query output for field 'ifIndex'
Executing script query '/usr/bin/python3 /var/www/html/cacti/scripts/40G_test.py 'ip address omitted' 'query' 'ifindexi''
Found item [ifIndex='16847105'] index: 16847105
Found item [ifIndex='16847106'] index: 16847106
Found item [ifIndex='16847361'] index: 16847361
Found item [ifIndex='16847362'] index: 16847362
Found item [ifIndex='17174785'] index: 17174785
Found item [ifIndex='17174786'] index: 17174786
Found item [ifIndex='17175041'] index: 17175041
Found item [ifIndex='17175042'] index: 17175042
Found item [ifIndex='17240321'] index: 17240321
Found item [ifIndex='17240322'] index: 17240322
Found item [ifIndex='17240577'] index: 17240577
Found item [ifIndex='17240578'] index: 17240578

Click to show Data Query output for field 'ifNameDescr'
Executing script query '/usr/bin/python3 /var/www/html/cacti/scripts/40G_test.py 'ip address omitted' 'query' 'descr''
Found item [ifNameDescr='100GE1/0/0'] index: 16847105
Found item [ifNameDescr='100GE1/0/1'] index: 16847106
Found item [ifNameDescr='100GE1/1/0'] index: 16847361
Found item [ifNameDescr='100GE1/1/1'] index: 16847362
Found item [ifNameDescr='100GE6/0/0'] index: 17174785
Found item [ifNameDescr='100GE6/0/1'] index: 17174786
Found item [ifNameDescr='100GE6/1/0'] index: 17175041
Found item [ifNameDescr='100GE6/1/1'] index: 17175042
Found item [ifNameDescr='100GE7/0/0'] index: 17240321
Found item [ifNameDescr='100GE7/0/1'] index: 17240322
Found item [ifNameDescr='100GE7/1/0'] index: 17240577
Found item [ifNameDescr='100GE7/1/1'] index: 17240578
Total: 4.990000, Delta: 2.860000, Checking for Sort Field change. No changes detected.
Total: 4.990000, Delta: 0.000000, Update Data Query Sort Cache complete
Total: 8.480000, Delta: 3.500000, Index Association with Local Data complete
Total: 8.490000, Delta: 0.010000, No Index Changes Detected, Skipping Re-Index and Poller Cache Re-population
Total: 8.490000, Delta: 0.000000, Automation Executing for Data Query complete
Total: 8.490000, Delta: 0.000000, Plugin hooks complete


Script seems to work fine for get arg as well:
#############################################
snmpwalk response:
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.3.1.32.16847105 = STRING: "-116,-271,-142,-176"

Script response:

# /usr/bin/python3 40G_test.py (ip address omitted) get rxpower1 16847105
-116
# /usr/bin/python3 40G_test.py (ip address omitted) get rxpower2 16847105
-271
# /usr/bin/python3 40G_test.py (ip address omitted) get rxpower3 16847105
-142
# /usr/bin/python3 40G_test.py (ip address omitted) get rxpower4 16847105
-176

#####################################
Data Source Debug

/usr/bin/rrdtool create \
/var/www/html/cacti/rra/459/36267.rrd \
--start -900 --step 300 \
DS:40g_rx_script_lane1:GAUGE:600:U:U \
DS:40g_rx_script_lane2:GAUGE:600:U:U \
DS:40g_rx_script_lane3:GAUGE:600:U:U \
DS:40g_rx_script_lane4:GAUGE:600:U:U \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \


Graph debug:
#########################################################

RRDtool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start='-86400' \
--end='-300' \
--pango-markup \
--title=' - Optical Levels 4 Lanes - 100GE1/0/0' \
--vertical-label='dBm' \
--slope-mode \
--base=1000 \
--height=120 \
--width=500 \
--tabwidth '30' \
--rigid \
--alt-autoscale \
COMMENT:"From 2019/12/25 16\:06\:04 To 2019/12/26 16\:01\:04\c" \
COMMENT:" \n" \
--color BACK#F3F3F3 \
--color CANVAS#FDFDFD \
--color SHADEA#CBCBCB \
--color SHADEB#999999 \
--color FONT#000000 \
--color AXIS#2C4D43 \
--color ARROW#2C4D43 \
--color FRAME#2C4D43 \
--border 1 --font TITLE:11:'Arial' \
--font AXIS:8:'Arial' \
--font LEGEND:8:'Courier' \
--font UNIT:8:'Arial' \
--font WATERMARK:6:'Arial' \
--slope-mode \
--watermark 'Generated by Cacti®' \
DEF:a='/var/www/html/cacti/rra/459/36269.rrd':'40g_tx_script_lane1':AVERAGE \
DEF:b='/var/www/html/cacti/rra/459/36269.rrd':'40g_tx_script_lane2':AVERAGE \
DEF:c='/var/www/html/cacti/rra/459/36269.rrd':'40g_tx_script_lane3':AVERAGE \
DEF:d='/var/www/html/cacti/rra/459/36269.rrd':'40g_tx_script_lane4':AVERAGE \
CDEF:cdefa='a,100,/' \
CDEF:cdefc='b,100,/' \
CDEF:cdefe='c,100,/' \
CDEF:cdefg='d,100,/' \
LINE2:cdefa#F51D30FF:'Tx Lane1 ' \
GPRINT:cdefa:LAST:'Current\:%8.2lf %s\n' \
LINE2:cdefc#0000FFFF:'Tx Lane2 ' \
GPRINT:cdefc:LAST:'Current\:%8.2lf %s\n' \
LINE2:cdefe#00BD27FF:'Tx Lane 3' \
GPRINT:cdefe:LAST:'Current\:%8.2lf %s\n' \
LINE2:cdefg#000000FF:'Tx Lane 4' \
GPRINT:cdefg:LAST:'Current\:%8.2lf %s\n'

RRDtool Says:

ERROR: opening '/var/www/html/cacti/rra/459/36269.rrd': No such file or directory



#######################

Hope I get a reply this time? :)

ntrazivuk
Posts: 6
Joined: Thu Nov 07, 2019 6:49 am

Re: RRD files not created for Get Script Data (Indexed) sources

#2 Post by ntrazivuk » Thu Dec 26, 2019 10:38 am

sorted, was a silly mistake. I dont know how to delete the post. :)

User avatar
TheWitness
Developer
Posts: 14855
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: RRD files not created for Get Script Data (Indexed) sources

#3 Post by TheWitness » Sun Jan 05, 2020 12:44 pm

:D :D :D :D

Too funny
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

kiran229
Posts: 2
Joined: Wed Jan 22, 2020 5:35 am

Re: RRD files not created for Get Script Data (Indexed) sources

#4 Post by kiran229 » Wed Jan 22, 2020 5:43 am

I am facing the same issue in RRD file creation, how did the issue got resolved.

User avatar
TheWitness
Developer
Posts: 14855
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: RRD files not created for Get Script Data (Indexed) sources

#5 Post by TheWitness » Wed Jan 22, 2020 7:54 am

Generally, it due to :

1) File permissions, but you could not have installed with that
2) Crontab not running or crontab settings wrong
3) Selecting spine data collector even though you have not installed it.

Reviewing your Cacti Log file should tell you at least half of what you need to know.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

Post Reply