Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NCPA "no such file or directory" error #523

Closed
dbcummings opened this issue Mar 18, 2019 · 16 comments
Closed

NCPA "no such file or directory" error #523

dbcummings opened this issue Mar 18, 2019 · 16 comments
Labels
Milestone

Comments

@dbcummings
Copy link

When either the listener or passive service are trying to load, I receive the follow errors on some net mapped directories. Is there a way to disregard certain mounted filesystems.

ERROR:root:[Errno 2] No such file or directory: (directory name)
Traceback (most recent call last):
File "/root/ncpa/agent/listener/psapi.py", line 186, in get_disk_node
File "/root/ncpa/agent/listener/psapi.py", line 58, in make_mountpoint_nodes

@dbcummings
Copy link
Author

Additional note: The services will start with an OS reboot

@jomann09
Copy link
Contributor

In NCPA you can change the types of mountpoints that it should look for. What does the check look like? Are you doing a check on the directory/mountpoint itself?

@dbcummings
Copy link
Author

I am not doing a check on this mount point. I have this issue during the initial deployment of the agent. It appears to check the filesystems during startup of the services.

@jomann09
Copy link
Contributor

In ncpa.cfg there is an option for exclude_fs_types that should have a list of types to exclude, if you aren't checking any mountpoints of the same type that is causing the problem you could try to exclude it https://www.nagios.org/ncpa/help.php#configuration-option-reference

I'll have to check why it's not properly continuing after the error.

@dbcummings
Copy link
Author

Ok. Let me give that a shot while you check on the error. Thank you.

@dbcummings
Copy link
Author

Ok. The mounts are NFS. However, this is already in the exclude_fs_types option. So, I am not sure why it is even looking at these.

@jomann09
Copy link
Contributor

Are you running NCPA as the default nagios user or are you running it as root? It's possible that it is unable to get the info for the mountpoint. Reading the code it shouldn't get to the part that is erroring if the filesystem type is nfs. I've had some issues with Debian 9 and having to run the agent as root in the past due to permissions problems.

@dbcummings
Copy link
Author

It has been running as Nagios. I will try root and see if there is an impact.

@dbcummings
Copy link
Author

Ok. The agent is running as root and it is still getting this error on multiple mount points that should be ignored as they are NFS.

Traceback (most recent call last):
File "/root/ncpa/agent/listener/psapi.py", line 186, in get_disk_node
File "/root/ncpa/agent/listener/psapi.py", line 58, in make_mountpoint_nodes
OSError: [Errno 2] No such file or directory:

@jomann09
Copy link
Contributor

These should be ignored, and for some reason it's hitting the exception and not catching it properly so that it doesn't cause issues. I think we can add a fix in for 2.1.7 to stop this.

@jomann09 jomann09 added the Bug label Mar 31, 2019
@jomann09 jomann09 added this to the 2.1.7 milestone Mar 31, 2019
@jomann09 jomann09 closed this as completed May 1, 2019
@dbcummings
Copy link
Author

I am still having this issue in RHEL for the 2.1.7 agent.

@jomann09
Copy link
Contributor

It will likely still give an error (since it is an error) in the log but it should not stop the agent from running. Certain mountpoints on the system are not accessible to be read for whatever reason. Since I'm unable to make this happen on my system all I could do was catch the OSError.

@dbcummings
Copy link
Author

Ok. It might be a different problem. I get this error when starting the agent on RHEL 6.x.

2019-05-23 11:43:02,010 65904 INFO stopped
2019-05-23 11:46:01,155 69536 INFO started
2019-05-23 11:46:01,158 69536 INFO Using SSL version TLSv1
2019-05-23 11:46:01,178 69536 ERROR [Errno 97] Address family not supported by protocol
Traceback (most recent call last):
File "ncpa_listener.py", line 108, in run
File "/usr/local/lib/python2.7/site-packages/gevent/baseserver.py", line 360, in serve_forever
File "/usr/local/lib/python2.7/site-packages/gevent/baseserver.py", line 304, in start
File "/usr/local/lib/python2.7/site-packages/gevent/pywsgi.py", line 1450, in init_socket
File "/usr/local/lib/python2.7/site-packages/gevent/server.py", line 127, in init_socket
File "/usr/local/lib/python2.7/site-packages/gevent/server.py", line 138, in get_listener
File "/usr/local/lib/python2.7/site-packages/gevent/server.py", line 225, in _tcp_listener
File "/usr/local/lib/python2.7/site-packages/gevent/_socket2.py", line 107, in init
error: [Errno 97] Address family not supported by protocol

@jomann09
Copy link
Contributor

Oh that is a different problem, this may be an issue with Python, is the system running with an ipv6 address only?

@dbcummings
Copy link
Author

No. It has ipv4 as well.

@dbcummings
Copy link
Author

Got it to start. I had to change ip = :: to ip = 0.0.0.0 in the ncpa.cfg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants