trouble with nagios core imput script

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
Locked
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

trouble with nagios core imput script

Post by benhank »

Hello I am trying to follow these instructions:

Code: Select all

https://assets.nagios.com/downloads/nagios-log-server/docs/Sending-Nagios-Core-Logs-To-Nagios-Log-Server.pdf
and when I put in my servers ipaddy and run these commands:

Code: Select all

curl -s -O http://xxx.xxx.xxx.xxx/nagioslogserver/scripts/setup-linux.sh
sudo bash setup-linux.sh -s xxx.xxx.xxx.xxx -p 5544 -f "/usr/local/nagios/var/nagios.log" -t nagios_core
I get this error on three separate nagios core servers:

Code: Select all

setup-linux.sh: line 1: syntax error near unexpected token `newline'
setup-linux.sh: line 1: `<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">'
I am running Nagios Log Server 2.1.10
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: trouble with nagios core imput script

Post by pbroste »

Hello @benhank

Thanks for reaching out, want to verify the user account that you are logged is as and if there is security application blocking things.

Verify that you are root:

Code: Select all

whoami
Selinux is disabled:

Code: Select all

sestatus
Re-run to verify with -x switch: (the 'curl -sS -0 HTTP://..... command downloads the script so it is already in the directory)

Code: Select all

sudo bash -x setup-linux.sh -s xxx.xxx.xxx.xxx -p 5544 -f "/usr/local/nagios/var/nagios.log" -t nagios_core
Please let us know how that looks,
Perry
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: trouble with nagios core imput script

Post by benhank »

Same error after running the modified command running as root and selinux is disabled
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: trouble with nagios core imput script

Post by pbroste »

Hello @benhank

What does the output on this look like?

Verifying set -e

Code: Select all

set -e
echo $HOME

Code: Select all

sudo bash -x setup-linux.sh -s xxx.xxx.xxx.xxx -p 5544 -f "/usr/local/nagios/var/nagios.log" -t nagios_core
Thanks,
Perry
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: trouble with nagios core imput script

Post by benhank »

hi perry its fixed

I opened the

Code: Select all

/tmp/setup_linux.sh 
file.
Here are the contents:

Code: Select all

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="https://myhost.domain.com/nagioslogserver/scripts/setup-linux.sh">here</a>.</p>
</body></html>
So I opened the link, downloaded the file. replaced the

Code: Select all

/tmp/setup_linux.sh 
, with the one in the redirect link.
I then ran the command you gave me and its working now
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: trouble with nagios core imput script

Post by pbroste »

Excellent, thanks for updating the post with the details on how you resolved the issue.

I will go ahead and lock this,
Perry
Locked