Nagios 5.5: This rapid response URL has expired

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
duhd
Posts: 27
Joined: Fri May 13, 2016 9:08 am

Nagios 5.5: This rapid response URL has expired

Post by duhd »

After upgrade to 5.5, I have this error when click to a rapid response URL in email alert:

Code: Select all

SQL Error [nagiosxi] : ERROR:  function unix_timestamp(timestamp without time zone) does not exist
LINE 1: SELECT *, UNIX_TIMESTAMP(auth_valid_until) as valid_until_ts...
                  ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
And

Code: Select all

Rapid Response
Error: This rapid response URL has alread been used.
You must login to view this object.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios 5.5: This rapid response URL has expired

Post by lmiltchev »

What was the Nagios XI version that you upgraded from? OS/distro/architecture? Was this rapid response URL already used? Do you see errors when you click on a new rapid response link?

Run the following command from the CLI and show the output:

Code: Select all

grep response /usr/local/nagiosxi/html/config.inc.php
Also, go to Admin > System Settings > Security, and show a screenshot of this page. Thank you!
Be sure to check out our Knowledgebase for helpful articles and solutions!
duhd
Posts: 27
Joined: Fri May 13, 2016 9:08 am

Re: Nagios 5.5: This rapid response URL has expired

Post by duhd »

I'm upgrade from 5.4.13

Code: Select all

[root@nagios ~]# grep response /usr/local/nagiosxi/html/config.inc.php
// Secure notification %responseurl%
// setting this to 1 will force users to login in the response URL
// $cfg['secure_response_url']=1;
lmiltchev wrote:What was the Nagios XI version that you upgraded from? OS/distro/architecture? Was this rapid response URL already used? Do you see errors when you click on a new rapid response link?

Run the following command from the CLI and show the output:

Code: Select all

grep response /usr/local/nagiosxi/html/config.inc.php

Also, go to Admin > System Settings > Security, and show a screenshot of this page. Thank you!
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios 5.5: This rapid response URL has expired

Post by lmiltchev »

The issue will be fixed in the Nagios XI 5.5.1. Meanwhile, if you need an immediate "workaround", you can try the following:

1. Make a backup of your original "/usr/local/nagiosxi/html/includes/utils-users.inc.php" file.

Code: Select all

cp -p /usr/local/nagiosxi/html/includes/utils-users.inc.php /usr/local/nagiosxi/html/includes/utils-users.inc.php.original
2. Download the zip file below:
utils-users.inc.php.zip
unzip it, and copy the new "utils-users.inc.php" file over to the "/usr/local/nagiosxi/html/includes/" directory, overwriting the original "utils-users.inc.php" file.

3. Test the RR URL functionality to see if the issue has been resolved.
You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
duhd
Posts: 27
Joined: Fri May 13, 2016 9:08 am

Re: Nagios 5.5: This rapid response URL has expired

Post by duhd »

Thanks lmiltchev,

I'm cp that file and test again, received message with any new RR URL:

Code: Select all

Rapid Response
Error: This rapid response URL has alread been used.
You must login to view this object.

Why am I getting this error?
Verify the rapid response URL is the exact same as in the notifiction. Possible reasons for error include:
The single use URL has already been used
The URL has expired
Invalid or no auth token given in URL
lmiltchev wrote:The issue will be fixed in the Nagios XI 5.5.1. Meanwhile, if you need an immediate "workaround", you can try the following:

1. Make a backup of your original "/usr/local/nagiosxi/html/includes/utils-users.inc.php" file.

Code: Select all

cp -p /usr/local/nagiosxi/html/includes/utils-users.inc.php /usr/local/nagiosxi/html/includes/utils-users.inc.php.original
2. Download the zip file below:
utils-users.inc.php.zip
unzip it, and copy the new "utils-users.inc.php" file over to the "/usr/local/nagiosxi/html/includes/" directory, overwriting the original "utils-users.inc.php" file.

3. Test the RR URL functionality to see if the issue has been resolved.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios 5.5: This rapid response URL has expired

Post by lmiltchev »

Go to Admin > System Settings > Security, and show a screenshot of this page.

Also run the following commands and show the output:

Code: Select all

ls -la /usr/local/nagiosxi/html/includes/utils-users*

Code: Select all

sed -n 1894,1908p /usr/local/nagiosxi/html/includes/utils-users.inc.php
Be sure to check out our Knowledgebase for helpful articles and solutions!
duhd
Posts: 27
Joined: Fri May 13, 2016 9:08 am

Re: Nagios 5.5: This rapid response URL has expired

Post by duhd »

Go to Admin > System Settings > Security, and show a screenshot of this page.
nagios.PNG
Also run the following commands and show the output:
ls -la /usr/local/nagiosxi/html/includes/utils-users*

Code: Select all

[root@nagios ~]# ls -la /usr/local/nagiosxi/html/includes/utils-users*
-rw-r----- 1 nagios nagios 68564 Jul 10 09:16 /usr/local/nagiosxi/html/includes/utils-users.inc.php
sed -n 1894,1908p /usr/local/nagiosxi/html/includes/utils-users.inc.php

Code: Select all

[root@nagios ~]# sed -n 1894,1908p /usr/local/nagiosxi/html/includes/utils-users.inc.php
    global $db_tables;

    $sql = "SELECT * FROM ".$db_tables[DB_NAGIOSXI]['auth_tokens']." WHERE auth_token = ".escape_sql_param($auth_token, DB_NAGIOSXI, true);
    if (!($rs = exec_sql_query(DB_NAGIOSXI, $sql))) {
        return false;
    }

    $arr = $rs->GetArray();
    if (!empty($arr)) {
        $arr = $arr[0];

        // Convert valid until to timestamp
        $arr['valid_until_ts'] = strtotime($arr['auth_valid_until']);
        return $arr;
    }
You do not have the required permissions to view the files attached to this post.
Cpt.Ackbar
Posts: 31
Joined: Thu Aug 17, 2017 7:14 am

Re: Nagios 5.5: This rapid response URL has expired

Post by Cpt.Ackbar »

I tested it and it seems OK for me for pdf.

@duhd
Do not forget to set up proper privileges.

Code: Select all

chmod 750 /usr/local/nagiosxi/html/includes/utils-users.inc.php
chown nagios:nagios /usr/local/nagiosxi/html/includes/utils-users.inc.php
Verification: both files have to have same privileges and ownership

Code: Select all

[root@nagios ~]# ll /usr/local/nagiosxi/html/includes/ | grep utils-users.inc
-rwxr-x---   1 nagios nagios  68564 Jul  6 23:50 utils-users.inc.php
-rwxr-x---   1 nagios nagios  68480 Jun 29 12:10 utils-users.inc.php.original
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios 5.5: This rapid response URL has expired

Post by scottwilkerson »

Is the response URL from a new email? Or an older one?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
duhd
Posts: 27
Joined: Fri May 13, 2016 9:08 am

Re: Nagios 5.5: This rapid response URL has expired

Post by duhd »

That is URL from new email.
scottwilkerson wrote:Is the response URL from a new email? Or an older one?
Locked