Service restart in AIX

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
keerthi.seetharaman
Posts: 92
Joined: Thu Jan 11, 2018 7:55 am

Service restart in AIX

Post by keerthi.seetharaman »

Hi Team,

Good Day.

I have downloaded the ncpa rpm package and installed the rpm package in AIX server. Version of the AIX server is 7.1 with technology level 05 and service pack 05. After installing RPM package i need to update the config file with community string which i did it .

We need to restart the service ncpa listener on AIX.

Can you please suggest me how to restart the service on the server.

Regards,
Keerthi Prashanth S
Thanks & Regards,
Keerthi Prashanth Seetharaman
User avatar
jbrunkow
Posts: 441
Joined: Fri Mar 13, 2020 10:45 am

Re: Service restart in AIX

Post by jbrunkow »

I believe the command to start NCPA on AIX would look similar to the following.

Code: Select all

/usr/local/ncpa/ncpa_listener --start
But, you may want to look at how other services are initialized on that machine, and model the command after that. This will most likely be an init type command.
managing services on IBM AIX

Do you want to configure the service to start every time the machine boots up, or start it just this once?
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!
keerthi.seetharaman
Posts: 92
Joined: Thu Jan 11, 2018 7:55 am

Re: Service restart in AIX

Post by keerthi.seetharaman »

We would like to start it only one time because as per the document from Nagios says that once we install the rpm files and make the necessary changes in ncpa.cfg file we need to restart the listener service in order to communicate with Nagios XI and to add the server under monitoring.
Thanks & Regards,
Keerthi Prashanth Seetharaman
User avatar
jbrunkow
Posts: 441
Joined: Fri Mar 13, 2020 10:45 am

Re: Service restart in AIX

Post by jbrunkow »

Do you see the listener in that folder?

Code: Select all

cd /usr/local/ncpa/
ls | grep ncpa
If so, run the command to start it from that location.

Code: Select all

/usr/local/ncpa/ncpa_listener --start
If the --start option is not correct, you may be able to see what options are available by opening that file with a text editor.

Code: Select all

vi ncpa_listener
If not, you could search for it.

Code: Select all

sudo find /usr -name ncpa_listener
Then check if it is running.

Code: Select all

ps -ef | grep ncpa
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!
keerthi.seetharaman
Posts: 92
Joined: Thu Jan 11, 2018 7:55 am

Re: Service restart in AIX

Post by keerthi.seetharaman »

Please find the below updates:-
Executed the below command:-

/usr/local/ncpa/ncpa_listener --start

and this is below error that i am facing while executing:-
[abc:root:/usr/local/ncpa:] /usr/local/ncpa/ncpa_listener --start
2020-06-03 09:36:49,428 15990884 ERROR failed to start due to an exception
Traceback (most recent call last):
File "/tmp/test/ncpa/agent/ncpadaemon.py", line 181, in start
File "/tmp/test/ncpa/agent/ncpadaemon.py", line 358, in check_pid_writable
SystemExit: unable to write to pidfile /usr/local/ncpa/var/run/ncpa_listener.pid
unable to write to pidfile /usr/local/ncpa/var/run/ncpa_listener.pid
[abc:root:/usr/local/ncpa:]

1. Permission for /usr/local/ncpa/var/run/ is correctly set to writable.
drwxrwxr-x 2 root nagios 256 Jun 3 09:33 /usr/local/ncpa/var/run/

2. Unable to edit as this is compiled file.
file /usr/local/ncpa/ncpa_listener
/usr/local/ncpa/ncpa_listener: executable (RISC System/6000) or object module

Please suggest what needs to be done.
Thanks & Regards,
Keerthi Prashanth Seetharaman
User avatar
jbrunkow
Posts: 441
Joined: Fri Mar 13, 2020 10:45 am

Re: Service restart in AIX

Post by jbrunkow »

Can you please share the contents of this script? ( either by PM or in the thread )

Code: Select all

/tmp/test/ncpa/agent/ncpadaemon.py
Let's have a look at what line 181 and 358 hold.

That's odd, it looks like you should have write access to that folder. Can you please try running the following commands to correct it anyways?

Code: Select all

chown -R nagios.nagios /usr/local/ncpa/var/run/*
chmod -R go+rw /usr/local/ncpa/var/run/*
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!
keerthi.seetharaman
Posts: 92
Joined: Thu Jan 11, 2018 7:55 am

Re: Service restart in AIX

Post by keerthi.seetharaman »

/tmp/test/ncpa/agent/ncpadaemon.py :- In the tmp folder i am not able to find the test folder and remaining folders.

[abc:root:/:] cd/tmp/test/ncpa/agent/
ksh: cd/tmp/test/ncpa/agent/: not found
[abc:root:/:]

Regarding the permission update:-

chown -R nagios.nagios /usr/local/ncpa/var/run/* :- From this directory till run is executable for which i have ran till the run and after that when checked the folder it is blank.
chmod -R go+rw /usr/local/ncpa/var/run/* :- Same comment as above.

Please suggest what needs to be done.
Thanks & Regards,
Keerthi Prashanth Seetharaman
User avatar
jbrunkow
Posts: 441
Joined: Fri Mar 13, 2020 10:45 am

Re: Service restart in AIX

Post by jbrunkow »

I'm sorry I didn't see this sooner, but there is actually a method listed in the NCPA document.

Code: Select all

stopsrc -s ncpa_listener
startsrc -s ncpa_listener
Can you please try running that and let me know if it works?
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!
keerthi.seetharaman
Posts: 92
Joined: Thu Jan 11, 2018 7:55 am

Re: Service restart in AIX

Post by keerthi.seetharaman »

This I have already tried which says the service is started but when checked it reflects as inoperative before raising this case.
Tried stopping the service and statred back but no go.
Thanks & Regards,
Keerthi Prashanth Seetharaman
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Service restart in AIX

Post by ssax »

Are you using the ncpa 2.2.1 version from here or what version are you using?

https://www.nagios.org/ncpa/#downloads

What do you have for uid and gid in your ncpa.cfg? The defaults should be:

Code: Select all

uid = nagios
gid = nagios
What is the output of these commands?

Code: Select all

lsuser ALL nagios
lsgroup nagios
Run these commands and send us the full output (you can cut off the errpt to only show the ncpa related ones):

Code: Select all

stopsrc -s ncpa_listener
startsrc -s ncpa_listener
lssrc -s ncpa_listener
errpt
errpt -a
Locked