NRDP - BAD TOKEN

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
estebanmonge
Posts: 50
Joined: Mon Feb 06, 2012 11:13 pm

NRDP - BAD TOKEN

Post by estebanmonge »

Hello I am trying NRDP, I installed as follow in your PDF.


But if I fill de the form in http://ip/nrdp/ I get always:
<result><status>-1</status><message>BAD TOKEN</message></result>

What is wrong?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: NRDP - BAD TOKEN

Post by slansing »

Where you are placing this address? Are you trying to contact it directly through your address bar? If it is on the remote NRDP client's side, have you made sure to pass your valid NRDP token in the config file so it can reach the XI server?
estebanmonge
Posts: 50
Joined: Mon Feb 06, 2012 11:13 pm

Re: NRDP - BAD TOKEN

Post by estebanmonge »

We use Nagios Core.

I used URL and a perl, ssh, php and python clients, all gets the message BAD TOKEN.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: NRDP - BAD TOKEN

Post by lmiltchev »

Did you verify that you have the correct token in the nrdp server config file?

Code: Select all

$cfg['authorized_tokens'] =
Do you see any errors in the apache error log?
Be sure to check out our Knowledgebase for helpful articles and solutions!
estebanmonge
Posts: 50
Joined: Mon Feb 06, 2012 11:13 pm

Re: NRDP - BAD TOKEN

Post by estebanmonge »

<?php
// NRDP Config File
// Copyright (c) 2010 Nagios Enterprises, LLC.
// License: Nagios Open Software License <http://www.nagios.com/legal/licenses>
//
// $Id: config.inc.php 12 2010-06-19 04:19:35Z egalstad $


// an array of one or more tokens that are valid for this NRDP install
// a client request must contain a valid token in order for the NRDP to response or honor the request
// NOTE: tokens are just alphanumeric strings - make them hard to guess!
$cfg['authorized_tokens'] = array(
//"ithinkitsok", // <-- not a good token
);

// do we require that HTTPS be used to access NRDP?
// set this value to 'false' to disable HTTPS requirement
$cfg["require_https"]=false;

// do we require that basic authentication be used to access NRDP?
// set this value to 'false' to disable basic auth requirement
$cfg["require_basic_auth"]=false;

// what basic authentication users are allowed to access NRDP?
// comment this variable out to allow all authenticated users access to the NRDP
$cfg["valid_basic_auth_users"]=array(
"nrdpuser"
);

// the name of the system group that has write permissions to the external command file
// this group is also used to set file permissions when writing bulk commands or passive check results
// NOTE: both the Apache and Nagios users must be a member of this group
$cfg["nagios_command_group"]="nagcmd";

// full path to Nagios external command file
$cfg["command_file"]="/usr/local/nagios/var/rw/nagios.cmd";

// full path to check results spool directory
$cfg["check_results_dir"]="/usr/local/nagios/var/spool/checkresults";

// full path to directory where temp scratch files can be written
// NOTE: the Apache user need to be able create files here, and the Nagios user needs to read/delete those same files, so the /tmp system directory won't work (it has a sticky bit on it)
$cfg["tmp_dir"]="/usr/local/nagios/var/tmp";


///////// DONT MODIFY ANYTHING BELOW THIS LINE /////////

$cfg['product_name']='nrdp';
$cfg['product_version']='1.0'
yancy
Posts: 523
Joined: Thu Oct 06, 2011 10:12 am

Re: NRDP - BAD TOKEN

Post by yancy »

estebanmonge,

Which version of Nagios Core are you running? There have been some reported issues with Core 4.0 and NRDP.


-Yancy
estebanmonge
Posts: 50
Joined: Mon Feb 06, 2012 11:13 pm

Re: NRDP - BAD TOKEN

Post by estebanmonge »

I used 3.3.1
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NRDP - BAD TOKEN

Post by scottwilkerson »

from you NRDP config file, change this

Code: Select all

$cfg['authorized_tokens'] = array(
//"ithinkitsok", // <-- not a good token
);
to

Code: Select all

$cfg['authorized_tokens'] = array(
"YOURTOKEN", 
);
where YOURTOKEN is replaced with the token you are using
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked