LibreNMS with Gateone, Access denied, WinSocket issue

Hi everybody,

I hope I’m asking this question on the right forum or hope there is someone with Gateone experience.

I’m currently creating a lab with LibreNMS and Gateone.

Ive got a local VM on Virtualbox runnning LibreNMS and installed Gateone which is running.
The VM is set on IP 10.x.x.58
I’ve added the following rule in the libre config.php file.
$config[‘gateone’][‘server’] = ‘http://10.x.x.58:8080/’;

In the Gateone server.conf file I’ve changed a few small things.

locale = “en_US”
pam_service = “login”
syslog_facility = “daemon”
syslog_host = None
enable_unix_socket = False
port = 8080
uid = “0”
url_prefix = “/”
user_dir = “/opt/gateone/users”
dtach = False
certificate = “certificate.pem”
log_to_stderr = False
session_logs_max_age = “30d”
gid = “0”
pid_file = “/var/run/gateone.pid”
sso_realm = None
cookie_secret = “NTIyYjgwQ0YmJkNDczMzk0MjFjYmZkOGIxYhYWNiM”
pam_realm = “librenms”
sso_service = “HTTP”
https_redirect = False
syslog_session_logging = False
disable_ssl = True
debug = False
session_dir = “/tmp/gateone”
auth = “none”
address = “”
api_timestamp_window = “30s”
log_file_num_backups = 10
logging = “info”
embedded = False
origins = "http://localhost;http://10.x.x.58:8080;https://localhost;http://127.0.0.1;h$
session_logging = False
unix_socket_path = “/var/run/gateone.sock”
ssl_auth = “none”
log_file_max_size = 104857600
session_timeout = “5d”
command = "/opt/gateone/plugins/ssh/scripts/ssh_connect.py -S '/tmp/gateone/%SESSION%/%S$
ca_certs = None
js_init = “”
keyfile = “keyfile.pem”
log_file_prefix = “/opt/gateone/logs/webserver.log”

The button in LibreNSM works fine but I get the following error.
Message From Gate One Server: Access denied for origin: http://10.x.x.58:8080
Message From Gate One Server: Access denied for origin: http://10.x.x.58:8080
Message From Gate One Server: If you feel this is incorrect you just have to add ‘10.x.x.58:8080’ to the ‘origin’ option in your server.conf. See the docs for details.

Anyone an idea?

Kind regards,
Tim

Hi,

I’m not an expert, but the “origins”: linein my config is an array:
"origins": ["localhost", "127.0.0.1", "librenms", "127.0.1.1"]

Tom

1 Like

I cannot access my gateone ATM, but I also think it has to be an array

1 Like

Thanks for the info!
I’m going to test it tomorrow once I’m back at the office!
First got to figure out how arrays work. (rookie).

Just have a look at the example from tslytsly

1 Like

I copied the array from tslytsly but it throws me an error

The origins line in my previous config was pre-configured by Gateone.

I can’t seem to figure out why I can’t login.

So I’ve rebuild everything from scratch and installed the dependencies carefully step by step and I’ve got it to work without any errors!

Just one last question.

I manually need to execute ./gateone.py to run the application.

Is it possible to run the application in the background automatically?

Thanks everyone!!

Great @TG86
I wasn’t saying you should copy my config exactly, but was just giving you an idea of how to set it up. :slight_smile:

In terms of running as a service, it’s the same as any linux service.
From the gateone install doc:

To stop/start/restart Gate One (as a service):

Red Hat/Debian/Ubuntu:      sudo service gateone stop/start/restart
Nearly everything else:     sudo /etc/init.d/gateone stop/start/restart

To make Gate One start on boot:

Ubuntu:          Starts on boot by default
Debian:          update-rc.d gateone defaults
Red Hat/CentOS:  chkconfig --add gateone
Gentoo:          rc-update add gateone default

Although you may need to do sudo systemctl start gateone

1 Like

Hi tslytsly,

I did try a suitable variation on your input, thanks for all your help!

Tim

Did you happen to document your install steps. I’ve probably tried 20 times to get it installed, each time with a clean install of Ubuntu or CentOS. I dead end when I try to run gateone (‘python gateone.py’) and I get the following:

netops@gateone:/opt/gateone$ ls
authpam.py gateone.py plugins static tests
auth.py i18n README.rst templates utils.py
babel_gateone.cfg LICENSE.txt remote_syslog.py terminal.py
docs logviewer.py sso.py termio.py
netops@gateone:/opt/gateone$ python gateone.py
Traceback (most recent call last):
File “gateone.py”, line 289, in
tornado.options.enable_pretty_logging()
AttributeError: ‘module’ object has no attribute ‘enable_pretty_logging’
netops@gateone:/opt/gateone$

1 Like

I do!
Just follow the steps in this link:
http://kentnagao.noip.me/joomla/index.php/27-install-gateone-html5-ssh-application

first off, you need to run this as root. (sudo su)

Before installing Gateone Ive update Ubuntu with the commands"
apt update
followed by ’ apt upgrade

installed ifconfig (apt install net-tools)
and installed nano (apt install nano)
to have the right tools.

rebooted the system en followed the steps in the link.
(make sure you log back in as root after rebooting (sudo su) )

Don’t forget to add the following: (last line on the webpage in the link)
sudo apt-get install python-pip debhelper python-support

If python-support is not available, you can install it as following.

wget http://launchpadlibrarian.net/109052632/python-support_1.0.15_all.deb
sudo dpkg -i python-support_1.0.15_all.deb

Your enable_pretty_logging is probably due to the wrong tornado version.
From the top of my head you need 2.7.4 (I can be wrong).
But if you follow the steps in the link from a clean install, it should work fine.

Hope this helps!

Here I go for about the 40th time…documenting my steps and we’ll see how it goes.

1 Like

Good luck!
(After many times I got it working right away with these steps).

To get rid of some errors you can install pillow and dtach afterwards.

Failed already on Step 1 of your instructions:

Create Virtual Machine w/ Ubuntu 18.04lts server
Install Ubuntu/config LAN
Set TimeZone (sudo dpkg-reconfigure tzdata)
sudo apt update
sudo apt upgrade

Snapshot Virtual Machine (to use again and again and again)

sudo su
apt install net-tools (net-tools is already installed)
apt install nano (nano is already installed)

reboot now

login
sudo su

sudo apt-get install python-support
** python-support has no installation candidate

wget http://launchpadlibrarian.net/109052632/python-support_1.0.15_all.deb
sudo dpkg -i python-support_1.0.15_all.deb
** Python-support depends on python (>=2.5)

Skip that.

Got the correct Tornado installed.

sudo dpkg -i gateone*.deb doesn’t seem to do much.

root@gateone:/home/netops# sudo dpkg -i gateone*.deb
(Reading database … 103645 files and directories currently installed.)
Preparing to unpack gateone_1.1-1_all.deb …
Unpacking gateone (1.1-1) over (1.1-1) …
Setting up gateone (1.1-1) …
Processing triggers for python-support (1.0.15) …
Processing triggers for systemd (237-3ubuntu10.11) …
Processing triggers for ureadahead (0.100.0-20) …
root@gateone:/home/netops#

If you follow step 2 and 3 the link, you should get the right versions installed.

Installing gateone is indeed about 3 seconds.

Did you follow step 2 and 3?

Yes. It is installed, but not responding. I edited the origins sections of the config file. No firewall is installed on Ubuntu, yet the page is not loading. I installed the extras:

sudo apt-get install python-pip debhelper python-support

The page does not load “Unable to connect”

I ran Angry IP scanner against the host and it shows no response to port 80 or 443 (HTTPS right?)

I changed over to the /opt/gateone directory and ran “python gateone.py”

And now it is working, but the service should already be running shouldn’t it?

How do I now ensure this is running as a service?

To get it running as a service is something I’m still working on.
Linux is a bit new to me, once I’ve got this figured out I’ll post an update.
Good to hear you got it working thus far.

As long as I had the SSH session open it was running yesterday. I came in to work this morning and of course it was not responding because the session had timed out. I logged back in and tried to run it with “python gateone.py” and it is again throwing back:

AttributeError: ‘module’ object has no attribute ‘enable_pretty_logging’

I’m about done with this application.