Hello Community
first… I’m Luis from Barcelona, I’m new in this world…and I start working with telegraf + influxdb + chronograf last week.
As Oracle dba, I would like to get metrics with this amazing system.
So, I create in my local PC the environment… I have influxdb working, telegraf and chronograf.
I use inputs.exec in order to grab Oracle data and send it throught the system
The .sh script is:
#!/bin/env bash
su - oracle -c "
export ORACLE_HOME=/home/oracle/app/oracle/product/122/db_home;export ORACLE_SID=orcl;
export PATH=$PATH:$ORACLE_HOME/bin
sqlplus -s ldiaz/xxxx <<EOF
SET PAGES 0
set heading off
SET FEEDBACK OFF
select ‘Active_session’||’ '||‘count=’||count(1) cnt from v\$session where status=‘ACTIVE’ and type<>‘BACKGROUND’;
EXIT;
EOF
"
If I try with Telegraf I get the following output:
@luisete2106,
Hello Luis (from Barcelona! <3 ),
Thanks for your question and welcome!
So you’re unsuccessful in writing points to InfluxDB with Telegraf exec plugin? Have you tried setting debug = true on your telegraf plugin?
Can you please share your telegraf config? That might help in debugging.
Hi Anais
Whooww , my daugther’s name is Anaïs too !!
Well, I can’t attach file, I have this message:
“Sorry, new users can not upload attachments.”
But anyway, this is the bashs script:
#!/bin/env bash
export ORACLE_HOME=/home/oracle/app/oracle/product/122/db_home;export ORACLE_SID=orcl;
export PATH=\$PATH:\$ORACLE_HOME/bin
/home/oracle/app/oracle/product/122/db_home/bin/sqlplus -s user/xxxx <<EOF
SET PAGES 0
set heading off
SET FEEDBACK OFF
select replace(ses.event,' ','_')||' '||'Count='||count(1) from v\$session ses inner join v\$session_wait sw ON ses.sid=sw.sid and sw.wait_class<>'idle' where ses.event is not null group by ses.event;
EXIT;
EOF
indent preformatted text by 4 spaces
This code runs fine with telegraf and infuxdb.
But, All the rows returned by this query create a MEASURMENT into influx… How can I create a category in order to have, from the data explore tab, Oracle category, as I have postgres or system?
The query generated is:
SELECT mean(“Count”) AS “mean_Count” FROM “telegraf”.“autogen”.“Data_Guard:_Gap_Manager” WHERE time > now() - 1h AND “host”=‘mipc’ GROUP BY time(:interval:) FILL(null)
Hi luise,
I am struggling from past 2 week write the telegraf input plugin for parsing the oracle alert log file.
I already wrote the script file but I am not able to create the measurement.
Can you please share or attached your telegraf configuration file .
It will match with my telegraf file and I will see where I did mistake.
Who is the owner/group of the script file? If I remember correctly, there is a user telegraf that runs the telegraf process. The script file would have to have the executable bit set chmod +x <script>.sh and the script file would have to be either owned by the telegraf user or the owner of the script file would have to be in the same UNIX group as the telegraf user.
/home/oracle/app/oracle/product/122/db_home/bin/sqlplus -s user/xxxx <<EOF
SET PAGES 0
set heading off
SET FEEDBACK OFF
select replace(ses.event,’ ‘,’_’)||’ '||‘Count=’||count(1) from v$session ses inner join v$session_wait sw ON ses.sid=sw.sid and sw.wait_class<>‘idle’ where ses.event is not null group by ses.event;
EXIT;
EOF