All,
Not really a SunOS guy, so might be missing something fundamental. I wrote the script I need, and it runs fine as the user I expect it do. Splunk is root and running as root.
Here I have a simple script that echos out some system information for our Splunk ES demo.
#/usr/bin/bash
ip=`/usr/sbin/ifconfig -a | grep -i inet | grep -i 10 | awk '{print $2}'`
mac=`/usr/sbin/ifconfig -a | grep -i ether | head -n 1 | awk '{print $2}'`
nt_host=`hostname`
dns=`nslookup $ip | grep -i name | awk '{print $4}'`
owner="user"
owner_email="
[email protected]"
owner_DL="
[email protected]"
# Lat and long work - default
lat=76.057837
long=-115.214195
# if sjr override the above with sjr lat and long
datacenter=${nt_host:0:3}
if [ $datacenter == "sjr" ]
then
lat=140.5622
long=121.9297
fi
echo "ip=$ip, mac=$mac, nt_host=$nt_host, dns=$dns, owner=$owner, owner_email=$owner_email, owner_DL=$owner_DL, priority=high,lat=$lat,long=$long,city=\"Las Vegas\", country=US, bunit=operations, category=cardholder, pci_domain=\"trust|cardholder\", is_expected=true, should_timesync=true, should_update=true, requires_av=false"
and here is the inputs.conf:
[script://./bin/getinfo.sh]
index=asset_discovery
sourcetype=assets:SunOS
interval=60
This script executes when run locally. I also verified the app runs fine on a LInux machine. I am getting other data from this forwarder. At this point I am out of ideas as to why this scripted input is failing.
... View more