Core services - Could not authenticate, Invalid Token Given

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Core services - Could not authenticate, Invalid Token Given

Post by vAJ »

I've read through the other threads that have this message, nothing work for me.

Fresh source install on CentOS vm. Go to reconfigure data_dir to separate partition, move files from original location, start elastic search back up. All logins are gone, have to use the curl command to add "someuser" back in. System status shows both core services down with "Could not authenticate. Invalid Token Given"

On a side note, I really wish all of the product documentation was in wiki form, not individual PDFs. Do I need corner @FatherofNagios next month to get this in the works? :?:
Andrew J. - Do you even grok?
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Core services - Could not authenticate, Invalid Token Gi

Post by jolson »

Go to reconfigure data_dir to separate partition, move files from original location
When you moved the files from the original location, are you certain that you moved *all* of them? I ask because the 'nagioslogserver' index is in control of the NLS login information, and if you don't move it before you start elasticsearch back up, elasticsearch is going to generate a new one without any credentials - this would result in the problem that you have.

Run the following command, and be sure that you have these indices: nagioslogserver, nagioslogserver_log, kibana-int.

Code: Select all

curl 'localhost:9200/_cluster/health?level=indices&pretty'
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Core services - Could not authenticate, Invalid Token Gi

Post by tmcdonald »

vAJ wrote:On a side note, I really wish all of the product documentation was in wiki form, not individual PDFs. Do I need corner @FatherofNagios next month to get this in the works? :?:
We've had people fiercely for and against both PDF and wiki format for a long time. We're working on something, no need to corner anyone :)
Former Nagios employee
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Re: Core services - Could not authenticate, Invalid Token Gi

Post by vAJ »

Code: Select all

[root@aus02gdnls01 logstash]# curl 'localhost:9200/_cluster/health?level=indices&pretty'
{
  "cluster_name" : "7f4cab6f-741e-454a-a588-027dce70bfcb",
  "status" : "yellow",
  "timed_out" : false,
  "number_of_nodes" : 1,
  "number_of_data_nodes" : 1,
  "active_primary_shards" : 6,
  "active_shards" : 6,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 6,
  "number_of_pending_tasks" : 0,
  "number_of_in_flight_fetch" : 0,
  "indices" : {
    "nagioslogserver_log" : {
      "status" : "yellow",
      "number_of_shards" : 5,
      "number_of_replicas" : 1,
      "active_primary_shards" : 5,
      "active_shards" : 5,
      "relocating_shards" : 0,
      "initializing_shards" : 0,
      "unassigned_shards" : 5
    },
    "nagioslogserver" : {
      "status" : "yellow",
      "number_of_shards" : 1,
      "number_of_replicas" : 1,
      "active_primary_shards" : 1,
      "active_shards" : 1,
      "relocating_shards" : 0,
      "initializing_shards" : 0,
      "unassigned_shards" : 1
    }
  }
}
Andrew J. - Do you even grok?
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Re: Core services - Could not authenticate, Invalid Token Gi

Post by vAJ »

From logstash.log:

Code: Select all

{:timestamp=>"2015-08-05T10:28:04.724000-0500", :message=>"Error: No config files found: /usr/local/nagioslogserver/logstash/etc/conf.d/*\nCan you make sure this path is a logstash config file?"}
{:timestamp=>"2015-08-05T10:28:04.731000-0500", :message=>"You may be interested in the '--configtest' flag which you can\nuse to validate logstash's configuration before you choose\nto restart a running system."}
I expect these as I haven't added any configs yet.
Andrew J. - Do you even grok?
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Core services - Could not authenticate, Invalid Token Gi

Post by jolson »

vAJ wrote:

Code: Select all

[root@aus02gdnls01 logstash]# curl 'localhost:9200/_cluster/health?level=indices&pretty'
{
  "cluster_name" : "7f4cab6f-741e-454a-a588-027dce70bfcb",
  "status" : "yellow",
  "timed_out" : false,
  "number_of_nodes" : 1,
  "number_of_data_nodes" : 1,
  "active_primary_shards" : 6,
  "active_shards" : 6,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 6,
  "number_of_pending_tasks" : 0,
  "number_of_in_flight_fetch" : 0,
  "indices" : {
    "nagioslogserver_log" : {
      "status" : "yellow",
      "number_of_shards" : 5,
      "number_of_replicas" : 1,
      "active_primary_shards" : 5,
      "active_shards" : 5,
      "relocating_shards" : 0,
      "initializing_shards" : 0,
      "unassigned_shards" : 5
    },
    "nagioslogserver" : {
      "status" : "yellow",
      "number_of_shards" : 1,
      "number_of_replicas" : 1,
      "active_primary_shards" : 1,
      "active_shards" : 1,
      "relocating_shards" : 0,
      "initializing_shards" : 0,
      "unassigned_shards" : 1
    }
  }
}
It looks like you only have 2 indices in your cluster - where is your new repository located? Can you verify that the 'nagios' user is capable of reading/writing to that repository?

Switch to 'nagios'.

Code: Select all

su - nagios
Cd to your new storage directory and make a file.

Code: Select all

cd /storage/dir
touch file
rm file
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Re: Core services - Could not authenticate, Invalid Token Gi

Post by vAJ »

Code: Select all

[root@aus02gdnls01 logstash]# su - nagios
This account is currently not available.
Didn't see that coming... Isn't fullinstall supposed to create nagios account?
Andrew J. - Do you even grok?
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Re: Core services - Could not authenticate, Invalid Token Gi

Post by vAJ »

Code: Select all

nagios:x:498:497::/var/spool/nagios:/sbin/nologin
Ehhh, but it is there and set for nologin...
Last edited by vAJ on Wed Aug 05, 2015 10:49 am, edited 1 time in total.
Andrew J. - Do you even grok?
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Core services - Could not authenticate, Invalid Token Gi

Post by jolson »

Please change nagios:x:498:497::/var/spool/nagios:/sbin/nologin to nagios:x:498:497::/var/spool/nagios:/bin/bash

At this point, you should be able to log in as the nagios user. It looks like the nagios user wasn't implemented properly.
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Re: Core services - Could not authenticate, Invalid Token Gi

Post by vAJ »

OK, I switch to nagios user and was able to create and remove files in /data01/elasticsearch/data/

ls of dir shows:
drwxr-xr-x 3 nagios nagios 4096 Aug 4 16:06 7f4cab6f-741e-454a-a588-027dce70bfcb
drwxr-xr-x 3 nagios nagios 4096 Aug 4 10:19 nodes
Andrew J. - Do you even grok?
Locked