Solaris 10 nrpe problems

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: Solaris 10 nrpe problems

Post by rajasegar »

bkoutsob wrote:Thank you for your help! If there is a list will many commands I will gladly use it as I need to test some services. Which means, as many as you have will be of use :)
Try doing it yourself first. You will learn a lot of things about Nagios pitfalls which will save you future headaches.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
bkoutsob
Posts: 10
Joined: Thu Aug 01, 2013 2:55 am

Re: Solaris 10 nrpe problems

Post by bkoutsob »

any idea on this?

bash-3.00# /usr/local/nagios/libexec/check_nrpe -H localhost -t 30 -c check_init_service -a 'httpd'
NRPE: Unable to read output

the command I defined:

command[check_init_service]=/usr/local/nagios/libexec/check_init_service $ARG1$ $ARG2$
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Solaris 10 nrpe problems

Post by lmiltchev »

The easiest way to go is to install the solaris agent by following the steps, outlined in this document:

http://assets.nagios.com/downloads/nagi ... _Agent.pdf

If you just need to create some commands on the client machine, here's the "default" commands that are normally added (if you used our installer):

Code: Select all

### GENERIC SERVICES ###
command[check_init_service]=/opt/nagios/libexec/check_init_service $ARG1$
command[check_services]=/opt/nagios/libexec/check_procs -w 1:100 -c 1:100 -C $ARG1$

### MISC SYSTEM METRICS ###
command[check_users]=/opt/nagios/libexec/check_users $ARG1$
command[check_load]=/opt/nagios/libexec/check_load $ARG1$
command[check_swap]=/opt/nagios/libexec/check_swap.pl $ARG1$
command[check_cpu_stats]=/opt/nagios/libexec/check_cpu_stats.sh $ARG1$
command[check_mem]=/opt/nagios/libexec/custom_check_mem $ARG1$

### DISK ###
command[check_disk]=/opt/nagios/libexec/check_disk $ARG1$
command[check_ide_smart]=/opt/nagios/libexec/check_ide_smart $ARG1$

### PROCESSES ###
command[check_all_procs]=/opt/nagios/libexec/custom_check_procs $ARG1$
command[check_procs]=/opt/nagios/libexec/check_procs $ARG1$

### OPEN FILES ###
command[check_open_files]=/opt/nagios/libexec/check_open_files.pl $ARG1$

### NETWORK CONNECTIONS ###
command[check_netstat]=/opt/nagios/libexec/check_netstat.pl -p $ARG1$ $ARG2$
Be sure to check out our Knowledgebase for helpful articles and solutions!
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: Solaris 10 nrpe problems

Post by rajasegar »

bkoutsob wrote:any idea on this?

bash-3.00# /usr/local/nagios/libexec/check_nrpe -H localhost -t 30 -c check_init_service -a 'httpd'
NRPE: Unable to read output

the command I defined:

command[check_init_service]=/usr/local/nagios/libexec/check_init_service $ARG1$ $ARG2$
What do you get when you run this in the server?
/usr/local/nagios/libexec/check_init_service httpd
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
bkoutsob
Posts: 10
Joined: Thu Aug 01, 2013 2:55 am

Re: Solaris 10 nrpe problems

Post by bkoutsob »

/usr/local/nagios/libexec/check_init_service: No such file or directory
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: Solaris 10 nrpe problems

Post by rajasegar »

bkoutsob wrote:/usr/local/nagios/libexec/check_init_service: No such file or directory
Install the nagios plugin. You can google it, the latest version is nagios-plugins-2.0.1 if I am not mistaken.

1) Download and extract then compile in dev machine
./configure
./make
./make install

2) Tar everything in /usr/local/nagios/libexec

3) Extract archive into target machine.
4) Run the following commands using root
chown nagios:nagios /usr/local/nagios/libexec
chown root:root /usr/local/nagios/libexec/check_dhcp
chown root:root /usr/local/nagios/libexec/check_icmp
chown root:root /usr/local/nagios/libexec/pst3
chmod ug=rx,u+s /usr/local/nagios/libexec/check_dhcp
chmod ug=rx,u+s /usr/local/nagios/libexec/check_icmp
chmod ug=rx,u+s /usr/local/nagios/libexec/pst3
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
bkoutsob
Posts: 10
Joined: Thu Aug 01, 2013 2:55 am

Re: Solaris 10 nrpe problems

Post by bkoutsob »

I installed the latest nagios plugins on my client. Still the sane error...
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: Solaris 10 nrpe problems

Post by rajasegar »

bkoutsob wrote:I installed the latest nagios plugins on my client. Still the sane error...
Ok. I dont use that anyway. Use this instead

command[rs_check_service]=/usr/local/nagios/libexec/rs_check_service $ARG1$

Code: Select all

#!/bin/sh
#
# This Nagios plug-in checks the state of SUN services
#
# Example:
#       ./check_svcs ipfilter
#
# This Plugin knows the following STATES of the svcs -a command of Solaris
#
#       0 | OK          | if online
#       1 | WARNING     | if disabled
#       1 | WARNING     | if maintenance
#       2 | CRITICAL    | if offline
#       3 | UNKNOWN     | if not available or it returns another state
#
# Version 1.0
#
# Nextiraone GmbH Kloten 19. November 2008
# Author: [email protected]

if [ $# -eq 0 ]; then
        echo "USAGE: $0 <service name>"
        exit 3
fi

SVCS=`svcs -a|grep $1| awk '{print $1}'`


case "$SVCS" in

online)
        echo OK $1 is $SVCS
        exit 0
        ;;
maintenance)
        echo WARNING $1 is in $SVCS
        exit 1
        ;;
disabled)
        echo WARNING $1 is in $SVCS
        exit 1
        ;;
offline)
        echo CRITICAL $1 is $SVCS
        exit 2
        ;;
*)
        echo UNKNOWN $1 is $SVCS
        exit 3
        ;;

esac


5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Solaris 10 nrpe problems

Post by tmcdonald »

bkoutsob, did rajasegar's post help?
Former Nagios employee
Locked