Return code of 255 is out of bounds
Return code of 255 is out of bounds
Hi guys,
Currently, I am using Nagios XI to monitor my database(Postgresql). However, on my webpage the service of monitoring database connection is always state as "Return code of 255 is out of bounds".
On my Nagios Server, when I execute below command, it's working fine.
/user/local/nagios/libexec/check_postgres.pl -H <remote ip> -p <port> -db <database> -u <user> --action=connection
The output return as ok:
POSTGRES_CONNECTION OK: DB "postgres" (host:192.168.1.123) version 9.3.4 | time=7.73s
On the CCM, when I run the test check command is also working fine. However, the webpage still state as "Return code of 255 is out of bounds".
Any advice for this issue?
Currently, I am using Nagios XI to monitor my database(Postgresql). However, on my webpage the service of monitoring database connection is always state as "Return code of 255 is out of bounds".
On my Nagios Server, when I execute below command, it's working fine.
/user/local/nagios/libexec/check_postgres.pl -H <remote ip> -p <port> -db <database> -u <user> --action=connection
The output return as ok:
POSTGRES_CONNECTION OK: DB "postgres" (host:192.168.1.123) version 9.3.4 | time=7.73s
On the CCM, when I run the test check command is also working fine. However, the webpage still state as "Return code of 255 is out of bounds".
Any advice for this issue?
Re: Return code of 255 is out of bounds
Try running that as the nagios user and see what the exit code is:
Code: Select all
su - nagios
/usr/local/nagios/libexec/check_postgres.pl -H <remote ip> -p <port> -db <database> -u <user> --action=connection
echo $?
exit
Former Nagios employee
Re: Return code of 255 is out of bounds
I have tried the command you provided on my nagios server, it will prompt up a password authentication, after I input the database password it return the output which shown as below:
POSTGRES_CONNECTION OK: DB "mytestdb" (host:192.168.1.100) version 9.3.4 | time=10.20
However, in my nagios Xi webpage is still stating as return code 255 is out of bound.
POSTGRES_CONNECTION OK: DB "mytestdb" (host:192.168.1.100) version 9.3.4 | time=10.20
However, in my nagios Xi webpage is still stating as return code 255 is out of bound.
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Return code of 255 is out of bounds
So, in that case when the plugin is run by nagios it is prompting for a password.iptribe wrote:I have tried the command you provided on my nagios server, it will prompt up a password authentication
When I run check_postgres.pl --help I get the following information:
-u --dbuser=NAME database user(s) to connect as; defaults to 'postgres'
--dbpass=PASS database password(s); use a .pgpass file instead when possible
--dbservice=NAME service name to use inside of pg_service.conf
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Return code of 255 is out of bounds
I also have tried on Nagios Server with this command:
/usr/local/nagios/libexec/check_postgres.pl -H <remote ip> -p <port> -db <database> -u <user> --dbpass=password --action=connection, and it's working fine in command line and also in the CCM when I test check command is also display the correct output.
However, on the Nagios XI service webpage, my service still state as "Return code of 255 is out of bounds".
/usr/local/nagios/libexec/check_postgres.pl -H <remote ip> -p <port> -db <database> -u <user> --dbpass=password --action=connection, and it's working fine in command line and also in the CCM when I test check command is also display the correct output.
However, on the Nagios XI service webpage, my service still state as "Return code of 255 is out of bounds".
Re: Return code of 255 is out of bounds
Is your service defined properly? Is is using the same command as the one that you tested from the CLI? Go to the CCM->Services-><your service>->View Text Output, and show us the service definition. Hide sensitive info.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Return code of 255 is out of bounds
Here is my service.....
define service {
host_name WCAS-DB
service_description Postgres Database Connection - db
use xiwizard_postgresdb_service
check_command check_postgres!-H <ip> -p <port> -db <db> -u <user> --dbpass=<password> --action=connection!!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
notifications_enabled 1
contacts nagiosadmin
contact_groups null
_xiwizard postgresdb
register 1
}
define service {
host_name WCAS-DB
service_description Postgres Database Size - db
use xiwizard_postgresdb_service
check_command check_postgres!-H <ip> -p <port> -db <db> -u <user> --dbpass=<password> --action=database_size --include=db -w 500M -c 800M!!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard postgresdb
register 1
}
define service {
host_name WCAS-DB
service_description Postgres Database Connection - db
use xiwizard_postgresdb_service
check_command check_postgres!-H <ip> -p <port> -db <db> -u <user> --dbpass=<password> --action=connection!!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
notifications_enabled 1
contacts nagiosadmin
contact_groups null
_xiwizard postgresdb
register 1
}
define service {
host_name WCAS-DB
service_description Postgres Database Size - db
use xiwizard_postgresdb_service
check_command check_postgres!-H <ip> -p <port> -db <db> -u <user> --dbpass=<password> --action=database_size --include=db -w 500M -c 800M!!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard postgresdb
register 1
}
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Return code of 255 is out of bounds
Can you also please give us the command definition for check_postgres
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Return code of 255 is out of bounds
How this servces were created? Did you run our Postgres Database wizard?
The "default" command that is used is:
which uses "check_postgres.pl"...
You have:
Can you show us the "check_postgres" command definition?
The "default" command that is used is:
Code: Select all
check_command check_xi_postgres_db!...You have:
Code: Select all
check_command check_postgres!...Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Return code of 255 is out of bounds
I have tried the default command before, but it didn't work for me. The CCM using this command is working fine, but also display the "Return code of 255 is out of bounds" on my service status.
Then I tried create another command name but with the same plugins which I am using now. But the result is same as the default command.
I also have updated the check_postgres.pl plugin to the latest version 2.21.0, please see my attachment. Any advice for this issue?
Code: Select all
define command {
command_name check_xi_postgres_db
command_line $USER1$/check_postgres.pl $ARG1$
} Code: Select all
define command {
command_name check_postgres
command_line $USER1$/check_postgres.pl $ARG1$
} You do not have the required permissions to view the files attached to this post.