check_nagiosxiserver.php not finding ticket

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
optionstechnology
Posts: 234
Joined: Thu Nov 17, 2016 11:26 am

check_nagiosxiserver.php not finding ticket

Post by optionstechnology »

NagiosXI 5.3.1
Centos 7

I am trying to monitor another NagiosXI server and have ran though the wizard but it ends the argument with '--ticket="' and doesn't actually populate the ticket info or complete the rest of the check syntax

How do I find the user ticket?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: check_nagiosxiserver.php not finding ticket

Post by rkennedy »

When you log in to the remote XI system, click the username, and this will show you the API ticket key for that user.

The wizard should populate it automatically when you provide the credentials to login though. I just tested on my machine and it appeared to work - does your password contain any symbols at all?
Former Nagios Employee
optionstechnology
Posts: 234
Joined: Thu Nov 17, 2016 11:26 am

Re: check_nagiosxiserver.php not finding ticket

Post by optionstechnology »

Oh yeah, it does

is there a way around or will I just change it?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: check_nagiosxiserver.php not finding ticket

Post by rkennedy »

optionstechnology wrote:Oh yeah, it does

is there a way around or will I just change it?
What symbol is it? I'd like to file a bug report, and re-create this as it should be doing some sanity checking.

You can adjust the $ARG1$ variable manually to the proper ticket key for that user on the destination machine. My guess is that it failed due to the symbol in the password, couldn't populate the wizard when logging in.
Former Nagios Employee
optionstechnology
Posts: 234
Joined: Thu Nov 17, 2016 11:26 am

Re: check_nagiosxiserver.php not finding ticket

Post by optionstechnology »

It was a hashtag

I have manually added the ticket and it appears to be working fine, although the XI Daemons and XI Jobs command are both returning 'No daemon information found.' and 'No job information found.'

Its definitely a nagiosxi server in full production...
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: check_nagiosxiserver.php not finding ticket

Post by ssax »

Please post the entire output of these commands (put the data in code tags):
- Make sure to change 192.168.X.X, nagiosadmin, and the ticket in both of the commands below

Code: Select all

/usr/bin/php /usr/local/nagios/libexec/check_nagiosxiserver.php --address=192.168.X.X --url=http://192.168.X.X/nagiosxi/ --username=nagiosadmin --ticket="6cgmp8a9" --mode=daemons --debug=1
/usr/bin/php /usr/local/nagios/libexec/check_nagiosxiserver.php --address=192.168.X.X --url=http://192.168.X.X/nagiosxi/ --username=nagiosadmin --ticket="6cgmp8a9" --mode=jobs --debug=1
Thank you
optionstechnology
Posts: 234
Joined: Thu Nov 17, 2016 11:26 am

Re: check_nagiosxiserver.php not finding ticket

Post by optionstechnology »

Daemon:

Code: Select all

RESULT:
Array
(
    [headers] => Array
        (
            [Date] => Tue, 13 Dec 2016 16:42:10 GMT
            [Server] => Apache/2.2.15 (CentOS)
            [X-Powered-By] => PHP/5.3.3
            [Set-Cookie] => nagiosxi=phb66bqmpmhcro8co0h11uti27; expires=Tue, 13-Dec-2016 17:12:10 GMT; path=/
            [Expires] => Thu, 19 Nov 1981 08:52:00 GMT
            [Cache-Control] => no-store, no-cache, must-revalidate, post-check=0, pre-check=0
            [Pragma] => no-cache
            [X-Frame-Options] => SAMEORIGIN
            [Content-Security-Policy] => frame-ancestors 'self'
            [Access-Control-Allow-Origin] => *
            [Content-Length] => 108
            [Connection] => close
            [Content-Type] => text/xml
        )

    [body] => <?xml version="1.0" encoding="utf-8"?>
<error>
<errormessage>Authentication Failure</errormessage>
</error>

    [info] => Array
        (
            [url] => http://########:80/nagiosxi//backend/
            [content_type] => text/xml
            [http_code] => 200
            [header_size] => 520
            [request_size] => 315
            [filetime] => -1
            [ssl_verify_result] => 0
            [redirect_count] => 0
            [total_time] => 0.182982
            [namelookup_time] => 0.000194
            [connect_time] => 0.002065
            [pretransfer_time] => 0.002071
            [size_upload] => 105
            [size_download] => 108
            [speed_download] => 590
            [speed_upload] => 573
            [download_content_length] => 108
            [upload_content_length] => 0
            [starttransfer_time] => 0.182898
            [redirect_time] => 0
            [certinfo] => Array
                (
                )

        )

)
XML DATA LOOKS OK
PHP Warning:  Invalid argument supplied for foreach() in /usr/local/nagios/libexec/check_nagiosxiserver.php on line 120
No daemon information found.
Jobs:

Code: Select all

RESULT:
Array
(
    [headers] => Array
        (
            [Date] => Tue, 13 Dec 2016 16:44:31 GMT
            [Server] => Apache/2.2.15 (CentOS)
            [X-Powered-By] => PHP/5.3.3
            [Set-Cookie] => nagiosxi=3i5qs4d4r93d3b76jtoa42b8g3; expires=Tue, 13-Dec-2016 17:14:31 GMT; path=/
            [Expires] => Thu, 19 Nov 1981 08:52:00 GMT
            [Cache-Control] => no-store, no-cache, must-revalidate, post-check=0, pre-check=0
            [Pragma] => no-cache
            [X-Frame-Options] => SAMEORIGIN
            [Content-Security-Policy] => frame-ancestors 'self'
            [Access-Control-Allow-Origin] => *
            [Content-Length] => 108
            [Connection] => close
            [Content-Type] => text/xml
        )

    [body] => <?xml version="1.0" encoding="utf-8"?>
<error>
<errormessage>Authentication Failure</errormessage>
</error>

    [info] => Array
        (
            [url] => http://#########:80/nagiosxi//backend/
            [content_type] => text/xml
            [http_code] => 200
            [header_size] => 520
            [request_size] => 315
            [filetime] => -1
            [ssl_verify_result] => 0
            [redirect_count] => 0
            [total_time] => 0.21176
            [namelookup_time] => 0.000135
            [connect_time] => 0.000625
            [pretransfer_time] => 0.000634
            [size_upload] => 105
            [size_download] => 108
            [speed_download] => 510
            [speed_upload] => 495
            [download_content_length] => 108
            [upload_content_length] => 0
            [starttransfer_time] => 0.211639
            [redirect_time] => 0
            [certinfo] => Array
                (
                )

        )

)
XML DATA LOOKS OK
CHECKING JOB reportengine (Report Engine)
CHECKING JOB sysstat (System Statistics)
CHECKING JOB eventman (Event Manager)
CHECKING JOB feedprocessor (Feed Processor)
CHECKING JOB cmdsubsys (Command Subsystem)
CHECKING JOB nom (Nonstop Operations Manager)
CHECKING JOB dbmaint (Database Maintenance)
CHECKING JOB cleaner (Cleaner)
No job information found.
(Please note I have hashed out the IP)
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: check_nagiosxiserver.php not finding ticket

Post by ssax »

Please PM me a copy of your profile, you can download it by going to Admin > System Config > System Profile and click the Download Profile button in the top right corner.

Are you using the API key (click on their username in the top right hand corner when logged in as them) OR are you using the backend ticket from Admin > Manage Components > Backend API URL?


Thank you
optionstechnology
Posts: 234
Joined: Thu Nov 17, 2016 11:26 am

Re: check_nagiosxiserver.php not finding ticket

Post by optionstechnology »

Using the API key by clicking on the username

I sent you my profile there
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: check_nagiosxiserver.php not finding ticket

Post by ssax »

Please use the ticket from Admin > Manage Components > Backend API URL > Configure icon, that's the one that is needed.

Let us know the results.


Thank you
Locked