Page 1 of 1

NRDP - BAD TOKEN

Posted: Mon Oct 14, 2013 2:58 pm
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?

Re: NRDP - BAD TOKEN

Posted: Mon Oct 14, 2013 3:47 pm
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?

Re: NRDP - BAD TOKEN

Posted: Mon Oct 14, 2013 11:19 pm
by estebanmonge
We use Nagios Core.

I used URL and a perl, ssh, php and python clients, all gets the message BAD TOKEN.

Re: NRDP - BAD TOKEN

Posted: Tue Oct 15, 2013 3:17 am
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?

Re: NRDP - BAD TOKEN

Posted: Tue Oct 15, 2013 11:55 am
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'

Re: NRDP - BAD TOKEN

Posted: Tue Oct 15, 2013 12:22 pm
by yancy
estebanmonge,

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


-Yancy

Re: NRDP - BAD TOKEN

Posted: Wed Nov 27, 2013 7:48 pm
by estebanmonge
I used 3.3.1

Re: NRDP - BAD TOKEN

Posted: Thu Nov 28, 2013 10:20 am
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