check_jabber_login.pl

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

check_jabber_login.pl

Post by gshergill »

Hi Nagios Community,

I've been trying out this new plugin, check_jabber_login.pl, to test login to Openfire Servers.

Running from the command line seems to work fine;

Code: Select all

root@nagios:/usr/local/nagios/etc# ../libexec/check_jabber_login.pl -H loki -p 5222 -u gshergill -P password
Use of uninitialized value $args{"file"} in lc at /home/localadm/perl5/lib/perl5/Net/XMPP/Debug.pm line 154.
Use of uninitialized value within @_ in lc at /home/localadm/perl5/lib/perl5/XML/Stream/Parser.pm line 71.
OK: Login for gshergill successful
But the web page shows;

Code: Select all

(null)
Checking on the page;

http://exchange.nagios.org/directory/Pl ... in/details

This seemed to be a problem.

I edited the line as recommended by schoppa, but that only stopped the line;

Code: Select all

Use of uninitialized value within @_ in lc at /home/localadm/perl5/lib/perl5/XML/Stream/Parser.pm line 71.
from appearing twice.

Any help can be provided for this plugin please?

The Openfire server is 3.6.4.

Thank you.

Kind Regards,

gshergill
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_jabber_login.pl

Post by scottwilkerson »

Try changing line 4 from

Code: Select all

use lib "nagios/plugins";
to this

Code: Select all

use lib "/usr/local/nagios/libexec";
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: check_jabber_login.pl

Post by gshergill »

Hi scottwilkerson,

Sorry I forgot to mention I've already made that change.

That mistake stops it from running in the command line even.

Thank you.

Kind Regards,

gshergill
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_jabber_login.pl

Post by scottwilkerson »

Is this an XI system? surely this should be the lib directory in an XI system
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: check_jabber_login.pl

Post by gshergill »

Hi scottwilkerson,

Sorry for the late response, I had to run yesterday.

I'm not entirely sure what you mean, am I missing a directory? Is there a general reason for why (null) errors appear?

The steps I ran through were as follows;

Copy the plugin to libexec folder.

Add the command to command.cfg;

Code: Select all

define command {
       command_name                             check_jabber_login.pl
       command_line                             $USER1$/check_jabber_login.pl -H $HOSTADDRESS$ -p 5222 -u $ARG1$ -P $ARG2$
}
Define the service on one of my systems;

Code: Select all

define service{
        use                             generic-service     
        host_name                       loki.<domain>
        service_description             Openfire Service 
        check_command                   check_jabber_login.pl!gshergill!Arcanine100
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        contacts                        nagiosadmin
        register                        1
        }
Run the command in command line - had error about utils.pm, so edited the plugin script.

Ran the plugin again on the command line - errors about Net/Jabber.

Ran the commands;

Code: Select all

cpan

install Net::Jabber
Error about Net::XMPP.

Code: Select all

install Net::XMPP
Errors again.

Code: Select all

force install Net::XMPP

fore install Net::Jabber
Ran the command again and it worked.

Restarted Nagios.

I don't think I'm missing any steps there.

Could the problem be with me needing to use "force" on the cpan? The error coming up was that the tests are failing to it couldn't complete the installation.

Worst case, I can just rollback the snapshot of the VM and try again.

Thank you.

Kind Regards,

gshergill
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: check_jabber_login.pl

Post by gshergill »

Hi scottwilkerson,

I realised my mistake, that was on a Nagios Core system with the null error and Parser.pm/Debug.pm.

On Nagios XI the error was something else, due to my failed installation of the cpan modules.

I installed all the previous modules required when prompted instead of just trying to use force at the start.

Does Nagios XI not come with the majority of the cpan modules installed or did I make a mistake on the installation of the system?

Just want to confirm this before I do the same on a production box and it causes further issues.

Or do you not recommend using cpan? Not sure what else to use to be honest.

Kind Regards,

gshergill
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_jabber_login.pl

Post by scottwilkerson »

Nagios XI only have packages that it requires pre-installed.

No problem installing others, but we don't want to bloat the machine too much with items not all users need.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: check_jabber_login.pl

Post by gshergill »

Hi scottwilkerson,

Thank you. I may not add this plugin to Nagios XI then, as it is not 100% needed yet.

Kind Regards,

gshergill
Locked