Page 3 of 5

Re: Option to monitor or check custom made services in Ubunt

Posted: Mon Nov 25, 2019 11:53 am
by epixelitsupport
See this is what im getting in my Nagios server Dashboard, https://prnt.sc/q1vlkh

I want to bring the custom service status here in the dashboard for the same client-server

Re: Option to monitor or check custom made services in Ubunt

Posted: Mon Nov 25, 2019 1:26 pm
by lmiltchev
Have you added your service in the nagios configs? Please read the Nagios Core documentation on object definitions (for services) here:

https://assets.nagios.com/downloads/nag ... ml#service

You may have something like this:

Code: Select all

define service {
    host_name                Epixel.in Server
    service_description      cmmt_revolution
    use                      sometemplate
    check_command            check_xi_ncpa!-t 'sometoken' -P 5693 -M 'plugins/servicescript.sh'
    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    
    register                 1
}
I don't know what your configs are like, so this is just an example... To make sure you don't have any config errors, after adding the new service, you would need to verify the configuration by running:

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
If you don't have any config errors (warnings are ok), restart nagios service, so that changes can take effect.

Code: Select all

service nagios restart
You should be able to see the new service now in the GUI.

Re: Option to monitor or check custom made services in Ubunt

Posted: Tue Nov 26, 2019 12:42 am
by epixelitsupport
This is what I'm added in my Nagios server config files

https://prnt.sc/q23ooh


and this is what I'm getting in as output in Nagios dashboard
https://prnt.sc/q23pl4

hope you understand it, could you please find an exact service to run it is as exactly what other service running in it

This is the output im getting while running the below command from my Nagios server
https://prnt.sc/q23rif

Re: Option to monitor or check custom made services in Ubunt

Posted: Tue Nov 26, 2019 11:25 am
by lmiltchev
You are testing your command from the command line on the Nagios server logged in as root... Test it logged in as nagios user.

Code: Select all

su - nagios
/usr/local/nagios/libexec/check_ncpa.py -H <ip address of the remote machine> -P 5693 -t <your token> -M 'plugins/servicescript.sh'
Do you have a "nagios" entry in sudoers file on the client? Can you run the following command on the remote machine and show the output?

Code: Select all

grep 'nagios\|requiretty' /etc/sudoers
In addition to this, can you show us how your check_ncpa command is configured?

Re: Option to monitor or check custom made services in Ubunt

Posted: Tue Nov 26, 2019 11:39 am
by lmiltchev
Actually, the more I look into this, the more I am convinced that this is a configuration issue. It is possible that you are passing the "-H x.x.x.x" twice, and this is what is causing the issue. Your sudoers may be fine. Show the check_ncpa command, so that we will know for sure.

Re: Option to monitor or check custom made services in Ubunt

Posted: Tue Nov 26, 2019 12:28 pm
by epixelitsupport
check_ncpa command means check_ncpa.py script??

where i can find it?( check_ncpa Command)
. Show the check_ncpa command, so that we will know for sure.

Re: Option to monitor or check custom made services in Ubunt

Posted: Tue Nov 26, 2019 1:39 pm
by lmiltchev
check_ncpa command means check_ncpa.py script??

where i can find it?( check_ncpa Command)
. Show the check_ncpa command, so that we will know for sure.
I have no idea how your Nagios server is configured... You should know that.

Normally, the commands are configured in the /usr/local/nagios/etc/objects/commands.cfg file. You should have a command that looks like this one:

Code: Select all

define command {
    command_name    check_ncpa
    command_line    $USER1$/check_ncpa.py -H $HOSTADDRESS$ $ARG1$
}
but it could look differently too. Again, we could not guess what you have on your system.

Note: Configuring Nagios Core could be someone challenging, especially for a beginner. If you are having difficulties with configuring/maintaining your Nagios Core server, perhaps you should look into purchasing Nagios XI.

https://www.nagios.com/products/nagios-xi/

Configuration on XI is done via configuration wizards, and it is a lot easier compared Nagios Core.

Re: Option to monitor or check custom made services in Ubunt

Posted: Tue Nov 26, 2019 1:54 pm
by epixelitsupport
yes i m used the same commands you mentioned above

define command {
command_name check_ncpa
command_line $USER1$/check_ncpa.py -H $HOSTADDRESS$ $ARG1$
}


Do i need to make any changes in it?

Re: Option to monitor or check custom made services in Ubunt

Posted: Tue Nov 26, 2019 2:47 pm
by lmiltchev
No, don't change your check_ncpa command. Change the "check_command" directive in the "cmmt_revolution" service by removing the "-H 3.219.197.251" part.

Example:

Code: Select all

check_command		check_ncpa!-t myepstoken -P 5693 -M plugins/servicescript.sh
Restart nagios, and check your service again. Let us know if it worked this time.

Re: Option to monitor or check custom made services in Ubunt

Posted: Wed Nov 27, 2019 2:04 am
by epixelitsupport
I added as you said in the service https://prnt.sc/q2na26

but still, it showing the output as https://prnt.sc/q2nb14

Please help me on this, Thanks for all your support so far.

Nagiosdashboard output: https://prnt.sc/q2nhu3


Do we need to consider the permission issues? please let me know