Issue with Status Inforamtion - Nagios XI

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Srinija544
Posts: 58
Joined: Mon Oct 15, 2018 9:30 pm

Issue with Status Inforamtion - Nagios XI

Post by Srinija544 »

Hi All,

We have placed a stored procedure in Nagios. But we are getting correct output when we do Run Check Command.

Run Check Command Output:

==================================================================================
Moderator Note: Content removed per request
===========================================================================

But In the original alert - Status Information, We are seeing error message:

WARNING - Use of uninitialized value $sql in sprintf at /usr/local/nagios/local/DB/MSSQL/check_mssql_health line 6509.
Use of uninitialized value in subroutine entry at /usr/local/lib64/perl5/DBD/Sybase.pm line 138.
Use of uninitialized value $sql in pattern match (m//) at /usr/local/nagios/local/DB/MSSQL/check_mssql_health line 6517.
Use of uninitialized value $sql in pattern match (m//) at /usr/local/nagios/local/DB/MSSQL/check_mssql_health line 6517.
, got no valid response for

[cat: /usr/local/nagios/local/DB/SQL/SSIS.sql: No such file or directory
Use of uninitialized value in sprintf at /usr/local/nagios/local/DB/MSSQL/check_mssql_health line 2953.]

===============================================================
Plugin Script:
Please find the attachment for the plugin script./
=============================================================
Command:
$USER2$/DB/MSSQL/check_mssql_health -t 20 --server $HOSTADDRESS$$ARG3$ --username=$ARG1$\\$USER5$ --password=$USER6$ --mode=$ARG2$
======================================================================

Please help me in solving this issue.

Regards,
Srinija.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Issue with Status Inforamtion - Nagios XI

Post by cdienger »

The command definition doesn't seem to match the command that is getting run - "--name "`cat /usr/local/nagios/local/DB/SQL/SSIS.sql`" --name2 'SSIS' --warning 1: --critical 0:" doesn't appear to be in the definition.

Double check the settings of the command definition as well as the plugin and please provide screenshots of the configuration and error if this doesn't help to resolve the problem.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Srinija544
Posts: 58
Joined: Mon Oct 15, 2018 9:30 pm

Re: Issue with Status Inforamtion - Nagios XI

Post by Srinija544 »

Hi cdienger,

Thank you for your response.

Please find the attached screenshots. If the command is wrong then we should get error in Run Check Command as well.

Regards,
Srinija.
You do not have the required permissions to view the files attached to this post.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Issue with Status Inforamtion - Nagios XI

Post by cdienger »

It's not clear where the "--name "`cat /usr/local/nagios/local/DB/SQL/SSIS.sql`" --name2 'SSIS' --warning 1: --critical 0:" part of the command is defined. Is it in $ARG2$? Try redefiing the command to look like:

Code: Select all

$USER2$/DB/MSSQL/check_mssql_health -t 20 --server $HOSTADDRESS$$ARG3$ --username=$ARG1$\\$USER5$ --password=$USER6$ --mode=$ARG2$ --name "`cat /usr/local/nagios/local/DB/SQL/SSIS.sql`" --name2 'SSIS' --warning 1: --critical 0:
and then only use "sql" in $ARG2$.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Srinija544
Posts: 58
Joined: Mon Oct 15, 2018 9:30 pm

Re: Issue with Status Inforamtion - Nagios XI

Post by Srinija544 »

Yes this command(sql --name "`cat /usr/local/nagios/local/DB/SQL/SSIS.sql`" --name2 'SSIS' --warning 1: --critical 0:) is in $ARG2$ but also we are getting the same issue.

$ARG1$: TOWER.LAN
$ARG3$: empty

when i run this command in server backend, i am gettnig correct output:
=========================
[root@dc1prd484 MSSQL]# ./check_mssql_health -t 20 --server dc1prd186.tower.lan --username=$ARG1$\\$USER5$ --password=$USER6$ --mode=sql --name "`cat /usr/local/nagios/local/DB/SQL/SSIS.sql`" --name2 'SSIS' --warning 1: --critical 0:
OK - ssis: 1 | 'ssis'=1;1:;0:
=========================

However, the output from the front end is different and wrong(doesn't satisfy our requirement).
==============================
WARNING - Use of uninitialized value $sql in sprintf at /usr/local/nagios/local/DB/MSSQL/check_mssql_health line 6509.
Use of uninitialized value in subroutine entry at /usr/local/lib64/perl5/DBD/Sybase.pm line 138.
Use of uninitialized value $sql in pattern match (m//) at /usr/local/nagios/local/DB/MSSQL/check_mssql_health line 6517.
Use of uninitialized value $sql in pattern match (m//) at /usr/local/nagios/local/DB/MSSQL/check_mssql_health line 6517.
, got no valid response for

[cat: /usr/local/nagios/local/DB/SQL/SSIS.sql: No such file or directory
Use of uninitialized value in sprintf at /usr/local/nagios/local/DB/MSSQL/check_mssql_health line 2953.]
===================================

Please find the attachment and help me on this.

Regards,
Srinija.
You do not have the required permissions to view the files attached to this post.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Issue with Status Inforamtion - Nagios XI

Post by mbellerue »

Can you run the command in the backend once more, except before you run it, do su - nagios and then run the command. I think it will fail, but it may give us more information on where it is failing.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Issue with Status Inforamtion - Nagios XI

Post by cdienger »

I've also attached a modified copy of the script to get more info in /usr/local/nagios/libexec/reports.txt to compare the user and arguments that are available when executed.

Did you try defining the command as I suggested in my previous post?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Srinija544
Posts: 58
Joined: Mon Oct 15, 2018 9:30 pm

Re: Issue with Status Inforamtion - Nagios XI

Post by Srinija544 »

Hi mbellerue,

I ran this command su - nagios before running my command still we get the same output no change:
=============================
[nagios@dc1prd484 ~]$ /usr/local/nagios/local/DB/MSSQL/check_mssql_health -t 20 --server dc1prd186.tower.lan --username=$ARG1$\\$USER5$ --password=$USER6$ --mode=sql --name "`cat /usr/local/nagios/local/DB/SQL/SSIS.sql`" --name2 'SSIS' --warning 1: --critical 0:
OK - ssis: 1 | 'ssis'=1;1:;0:;;
========================================


Hi cdienger,

I have tried executing your command also but getting the same output:

$USER2$/DB/MSSQL/check_mssql_health -t 20 --server $HOSTADDRESS$$ARG3$ --username=$ARG1$\\$USER5$ --password=$USER6$ --mode=$ARG2$ --name "`cat /usr/local/nagios/local/DB/SQL/SSIS.sql`" --name2 'SSIS' --warning 1: --critical 0:
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Issue with Status Inforamtion - Nagios XI

Post by cdienger »

The modifications will write the additional data to /usr/local/nagios/libexec/reports.txt. You may need to create this file first and make sure nagios has write permissions:

Code: Select all

touch /usr/local/nagios/libexec/reports.txt
chown nagios:nagios /usr/local/nagios/libexec/reports.txt
chmod 664 /usr/local/nagios/libexec/reports.txt
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Srinija544
Posts: 58
Joined: Mon Oct 15, 2018 9:30 pm

Re: Issue with Status Inforamtion - Nagios XI

Post by Srinija544 »

Hi mbellerue/cdienger,

This issue was resolved. Thank you all for your support.

Closing this request.

Regards,
Srinija.
Locked