Good day.
After upgrading to a new version of the application (1.5.08) in the log files appeared a new error message.
03-04-2015 08:01:17.077 +0300 ERROR ExecProcessor - message from "/opt/splunkforwarder/etc/apps/TA-nmon/bin/nmon_cleaner.sh --cleancsv" File "/opt/splunkforwarder/etc/apps/TA-nmon/bin/nmon_cleaner.py", line 223
03-04-2015 08:01:17.077 +0300 ERROR ExecProcessor - message from "/opt/splunkforwarder/etc/apps/TA-nmon/bin/nmon_cleaner.sh --cleancsv" WORKING_DIR = {CSV_DIR, CONFIG_DIR}
03-04-2015 08:01:17.077 +0300 ERROR ExecProcessor - message from "/opt/splunkforwarder/etc/apps/TA-nmon/bin/nmon_cleaner.sh --cleancsv" ^
03-04-2015 08:01:17.077 +0300 ERROR ExecProcessor - message from "/opt/splunkforwarder/etc/apps/TA-nmon/bin/nmon_cleaner.sh --cleancsv" SyntaxError: invalid syntax
03-04-2015 08:01:17.077 +0300 ERROR ExecProcessor - message from "/opt/splunkforwarder/etc/apps/TA-nmon/bin/nmon_cleaner.sh --cleancsv" WORKING_DIR = {CSV_DIR, CONFIG_DIR}
03-04-2015 08:01:17.077 +0300 ERROR ExecProcessor - message from "/opt/splunkforwarder/etc/apps/TA-nmon/bin/nmon_cleaner.sh --cleancsv" ^
03-04-2015 08:01:17.077 +0300 ERROR ExecProcessor - message from "/opt/splunkforwarder/etc/apps/TA-nmon/bin/nmon_cleaner.sh --cleancsv" SyntaxError: invalid syntax
^ point to comma in WORKING_DIR = {CSV_DIR, CONFIG_DIR}
This is the problem, the nmon_cleaner.py requires a Python 2.7.x interpreter.
What i could do is modifying the nmon_cleaner.sh to automatically choose the Perl version if the Python version available is not at least Python 2.7.x
Can you can check if running the Perl version works with no issue in your host: (with the same user that is running the UF)
/opt/splunkforwarder/bin/splunk cmd /opt/splunkforwarder/etc/apps/TA-nmon/bin/nmon_cleaner.pl
I have samve issue, But i did fixed it. Pls do it as below here
yum install perl-Time-HiRes
thanks
This is the problem, the nmon_cleaner.py requires a Python 2.7.x interpreter.
What i could do is modifying the nmon_cleaner.sh to automatically choose the Perl version if the Python version available is not at least Python 2.7.x
Can you can check if running the Perl version works with no issue in your host: (with the same user that is running the UF)
/opt/splunkforwarder/bin/splunk cmd /opt/splunkforwarder/etc/apps/TA-nmon/bin/nmon_cleaner.pl
After installing cpan + install Time::HiRes
Wed Mar 4 13:06:18 2015 Starting nmon cleaning:
Splunk Root Directory /opt/splunkforwarder nmon_cleaner version: 1.1.0 Perl version: 5.010001
No files found in directory: /opt/splunkforwarder/etc/apps/TA-nmon/var/nmon_repository/*.nmon, no action required.
Elapsed time was: 0.0004 seconds
Right,
Currently what you do is deactivation the nmon_helper.sh input script and activating the Perl version (but you will need to install required Perl modules if you have other Linux hosts with missing modules)
In your local/inputs.conf:
[script://./bin/nmon_cleaner.sh --cleancsv]
disabled = true
[script://./bin/nmon_cleaner.pl --cleancsv]
disabled = false
index = nmon
interval = 600
source = nmon_cleaner
sourcetype = nmon_clean
I will try to find a solution for such old Linux hosts
Thank you, guilmxm.
But host is not so old 🙂
[root@test-server-linux ~]# cat /etc/redhat-release
CentOS release 6.6 (Final)
Hi,
If this is fine for you, could mark this subject as answered please ?
Ok. We found workaround. 🙂
Plz convert to answer your comment.
Hi @arcdevil
I just converted the comment to an answer. If @guilmxm's workaround solved your question, be sure to accept his answer. If you found your own workaround, can you please share that here for @guilmxm and other users to see?
yeah not that old 🙂
After executing command:
[root@test-server-linux ~]# /opt/splunkforwarder/bin/splunk cmd /opt/splunkforwarder/etc/apps/TA-nmon/bin/nmon_cleaner.pl
Can't locate Time/HiRes.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /opt/splunkforwarder/etc/apps/TA-nmon/bin/nmon_cleaner.pl line 17.
BEGIN failed--compilation aborted at /opt/splunkforwarder/etc/apps/TA-nmon/bin/nmon_cleaner.pl line 17.
[root@test-server-linux ~]# perl --version
This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi
Hi,
I am checking this.
Could you please verify which Python version is available on that Linux host ? run: python --version
Hi.
Python 2.6.6