Deployment Architecture

Getting syntax error from interfaces.sh for *nix app

cyndiback
Path Finder

Ubuntu 10.10 / Splunk 4.2.1 / App: *nix 4.2

Yesterday we upgraded to the newest version of Splunk (4.2.1) and upgraded *nix app (4.2). Splunkd is now reporting the following errors:

  • message from "/opt/splunk/etc/apps/unix/bin/interfaces.sh" awk: line 1: syntax error at or near }
  • message from "/opt/splunk/etc/apps/unix/bin/interfaces.sh" awk: line 1: syntax error at or near else
  • message from "/opt/splunk/etc/apps/unix/bin/interfaces.sh" awk: line 1: syntax error at or near ,

I'm unable to identify what the syntax problem is. I've compared the interfaces.sh file on our server to what is posted on the web and they are the same. Is anyone else experiencing this problem?

Tags (3)
1 Solution

hazekamp
Builder

cyndiback, I don't have a specific fix at this time, but this is a known issue logged as (SOLN-1032). Please submit your own case to support@splunk.com for tracking.

Moderator edit:

UPDATE: this issue later became SPL-41361, and should be fixed in the next maintenance release of the app. In the meantime, the glorious Vainstein has provided a patch for ifconfig.sh (sorry about the lines wrapping):

# diff interfaces.sh interfaces-mod.sh 
41,42c41,42
<       SPEED=`dmesg | awk '/[Ll]ink( is | )[Uu]p/ && /'$iface'/ {for (i=1; i<=NF; ++i) {if (match($i, /([0-9]+)([Mm]bps)/, array)) {print array[1] "Mb/s"} else { if (match($i,/[Mm]bps/)) {print $(i-1) "Mb/s"} } } }' | sed '$!d'`
<       DUPLEX=`dmesg | awk '/[Ll]ink( is | )[Uu]p/ && /'$iface'/ {for (i=1; i<=NF; ++i) {if (match($i, /([\-\_a-zA-Z0-9]+)([Dd]uplex)/, array)) {print array[1]} else { if (match($i, /[Dd]uplex/)) {print $(i-1)} } } }' | sed 's/[-_]//g; $!d'`
---
>       SPEED=`dmesg  | awk '/[Ll]ink( is | )[Uu]p/ && /'$iface'/ {for (i=1; i<=NF; ++i) {if (match($i, "([0-9]+)([Mm]bps)"))             {print $i} else { if (match($i, "[Mm]bps"))   {print $(i-1) "Mb/s"} } } }' | sed '$!d'`
>       DUPLEX=`dmesg | awk '/[Ll]ink( is | )[Uu]p/ && /'$iface'/ {for (i=1; i<=NF; ++i) {if (match($i, "([\-\_a-zA-Z0-9]+)([Dd]uplex)")) {print $i} else { if (match($i, "[Dd]uplex")) {print $(i-1)       } } } }' | sed 's/[-_]//g; $!d'`

View solution in original post

dchayla
Engager

On debian :
- install gawk
- modify interfaces.sh :
-replace awk by gawk
- modify the line : CMD='ifconfig'. by removing the dot at the end of this line

it works for me after that

menkurau
Path Finder

we are still having this issue even after upgrading the *nix app to the latest version. anyone?

0 Karma

cafpereira
New Member

I'm also experiencing this same issue my Ubuntu server

0 Karma

dseagrav
Engager

This is caused by mawk. Debian installs mawk instead of gawk by default. Install gawk instead and the error will go away.

cyndiback
Path Finder

Tried resetting to gawk and rebooted machine...This did not fix the error.

0 Karma

poconnell
New Member

+1 having this issue on a new install, further information would be greatly appreciated...

0 Karma

vadud3
Path Finder

I am seeing the same error as well

0 Karma

hazekamp
Builder

cyndiback, I don't have a specific fix at this time, but this is a known issue logged as (SOLN-1032). Please submit your own case to support@splunk.com for tracking.

Moderator edit:

UPDATE: this issue later became SPL-41361, and should be fixed in the next maintenance release of the app. In the meantime, the glorious Vainstein has provided a patch for ifconfig.sh (sorry about the lines wrapping):

# diff interfaces.sh interfaces-mod.sh 
41,42c41,42
<       SPEED=`dmesg | awk '/[Ll]ink( is | )[Uu]p/ && /'$iface'/ {for (i=1; i<=NF; ++i) {if (match($i, /([0-9]+)([Mm]bps)/, array)) {print array[1] "Mb/s"} else { if (match($i,/[Mm]bps/)) {print $(i-1) "Mb/s"} } } }' | sed '$!d'`
<       DUPLEX=`dmesg | awk '/[Ll]ink( is | )[Uu]p/ && /'$iface'/ {for (i=1; i<=NF; ++i) {if (match($i, /([\-\_a-zA-Z0-9]+)([Dd]uplex)/, array)) {print array[1]} else { if (match($i, /[Dd]uplex/)) {print $(i-1)} } } }' | sed 's/[-_]//g; $!d'`
---
>       SPEED=`dmesg  | awk '/[Ll]ink( is | )[Uu]p/ && /'$iface'/ {for (i=1; i<=NF; ++i) {if (match($i, "([0-9]+)([Mm]bps)"))             {print $i} else { if (match($i, "[Mm]bps"))   {print $(i-1) "Mb/s"} } } }' | sed '$!d'`
>       DUPLEX=`dmesg | awk '/[Ll]ink( is | )[Uu]p/ && /'$iface'/ {for (i=1; i<=NF; ++i) {if (match($i, "([\-\_a-zA-Z0-9]+)([Dd]uplex)")) {print $i} else { if (match($i, "[Dd]uplex")) {print $(i-1)       } } } }' | sed 's/[-_]//g; $!d'`

mikelanghorst
Motivator

This is working fine on my linux host, and on Solaris for me. 4.2.1 as well.

0 Karma
Get Updates on the Splunk Community!

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...