I learn how to use nagios and i'm actually trying to monitor a host with the NCPA agent, but i didn't really understand what's happened.
Then, i first install the NCPA agent on my nagios core server (i dont know if it's a good idea to try to monitor the master). I succeed and I connected to the GUI.
Now i want to monitor the host with nagios, and i follow this guide : https://www.nagios.org/ncpa/getting-started.php#linux
I download the check_ncpa.py into usr/local/nagios/libexec. I create a check_ncpa command into the usr/local/nagios/etc/objects/commands.cfg file like this :
Code: Select all
###############################################################################
# COMMANDS.CFG - SAMPLE COMMAND DEFINITIONS FOR NAGIOS 4.4.1
#
#
# NOTES: This config file provides you with some example command definitions
# that you can reference in host, service, and contact definitions.
#
# You don't need to keep commands in a separate file from your other
# object definitions. This has been done just to make things easier to
# understand.
#
###############################################################################
define command {
command_name check_ncpa
command_line $USER1$/check_ncpa.py -H $HOSTADDRESS$ $ARG1$
}
################################################################################
#
# SAMPLE NOTIFICATION COMMANDS
#
# These are some example notification commands. They may or may not work on
# your system without modification. As an example, some systems will require
# you to use "/usr/bin/mailx" instead of "/usr/bin/mail" in the commands below.
#
################################################################################
define command {
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
}
...
Code: Select all
define host {
host_name nagioscore
address xxx.xxx.xxx.xxx
check_command check_ncpa!-t mytoken -P 5693 -M system/agent_version
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
contacts nagiosadmin
notification_interval 60
notification_period 24x7
notifications_enabled 1
icon_image ncpa.png
statusmap_image ncpa.png
register 1
}
define service {
host_name nagioscore
service_description CPU Usage
check_command check_ncpa!-t mytoken -P 5693 -M cpu/percent -w 20 -c 40 -q 'aggregate=avg'
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
notification_interval 60
notification_period 24x7
contacts nagiosadmin
register 1
}
define service {
host_name nagioscore
service_description Memory Usage
check_command check_ncpa!-t mytoken -P 5693 -M memory/virtual -w 50 -c 80 -u G
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
notification_interval 60
notification_period 24x7
contacts nagiosadmin
register 1
}
define service {
host_name nagioscore
service_description Process Count
check_command check_ncpa!-t mytoken -P 5693 -M processes -w 150 -c 200
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
notification_interval 60
notification_period 24x7
contacts nagiosadmin
register 1
}
I'm sorry if i'm not clear at all, and thank you in advance for your help