Page 1 of 2

check_nagiosxiserver.php not finding ticket

Posted: Fri Dec 09, 2016 3:52 am
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?

Re: check_nagiosxiserver.php not finding ticket

Posted: Fri Dec 09, 2016 10:44 am
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?

Re: check_nagiosxiserver.php not finding ticket

Posted: Fri Dec 09, 2016 10:56 am
by optionstechnology
Oh yeah, it does

is there a way around or will I just change it?

Re: check_nagiosxiserver.php not finding ticket

Posted: Fri Dec 09, 2016 11:07 am
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.

Re: check_nagiosxiserver.php not finding ticket

Posted: Mon Dec 12, 2016 2:58 pm
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...

Re: check_nagiosxiserver.php not finding ticket

Posted: Mon Dec 12, 2016 3:16 pm
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

Re: check_nagiosxiserver.php not finding ticket

Posted: Tue Dec 13, 2016 11:46 am
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)

Re: check_nagiosxiserver.php not finding ticket

Posted: Tue Dec 13, 2016 5:15 pm
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

Re: check_nagiosxiserver.php not finding ticket

Posted: Wed Dec 14, 2016 10:38 am
by optionstechnology
Using the API key by clicking on the username

I sent you my profile there

Re: check_nagiosxiserver.php not finding ticket

Posted: Wed Dec 14, 2016 2:58 pm
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