From where nagios run custom plugins - nagios

I am using nagios 3.2 for monitoring. I have a custom plug-in which I have placed in...
/usr/local/nagios/libexec, for nagios monitoring.
My custom plugin reads a configuration file for functioning properly. and this configuration file should be in the same directory.
Form this directory(../nagios/libexec), I am able to execute the binary.
However when nagios try to run it, it is not able to read associated configuration file.
Troubleshooting tried:-
1.) I have given full privileges to both binary and configuration file
-rwsrwxrwx 1 root root 2102 Mar 7 04:53 ------.properties
-rwsrwxrwx 1 root root 2079462 Mar 6 12:03 binary
Please let me know if nagios run the custom plugin from any other directory?
or any other suggestion...
Thanks,
Ruchir

Check /usr/local/nagios/etc/resource.cfg $USER1$ variable. It points to plugin directory.
Does your plugin need any privileges to access an specific dir or something? Maybe nagios user doesn't have access to it, or you need to add nagios to sudoers.

So I am able to find out by replacing by plugin with a scripts that gives directory (PWD)
and find out that it is running nagios daemon from / (root) directory.
So I have placed my configuration file there and it worked.
Thanks everone for your suggestions!!!

What language is this plugin written in (this sometimes makes a difference in how the plugin will handle your environment vars)? Have you tried using the FULL path to your configuration file, in the plugin (not just "./conffile)? If you su to the Nagios user and attempt to execute said plugin (with config), does it work?

Related

How do I run QuestDB from IntelliJ?

I would like to be able to run QuestDB from IntelliJ so that it sees the data I keep in a particular folder. What class should I run?, how do I set the root folder for the data?, is there anything I need to do regarding configuration (ports and the like)?, do I need to set any size for the memory settings?
I assume you have already imported QuestDB as a Maven project in IntelliJ.
In order to start it from the IDE, the entry point is the io.questdb.ServerMain class.
Then you need to create a new Run Configuration:
Open the Run/Debug configurations dialog, create a new Application configuration and make sure that you point out root dir with a -d flag (in the Program arguments field). Here's how my configuration looks like:

Nagios Plugin Error: (No output on stdout) ... failed. errno is 2: No such file or directory

I am using custom Nagios plugins for the first time and am running into this error when I create a service for the plugin.
(No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_load.py, ...) failed. errno is 2: No such file or directory
The plugin works when I run it on the command line, however does not work when it runs within Nagios.
I followed these steps to get the plugin into Nagios
https://assets.nagios.com/downloads/nagiosxi/docs/Managing-Plugins-in-Nagios-XI.pdf
Here is what it looks like in the Nagios UI
The plugin is in the correct path: /usr/local/nagios/libexec and the resource.cfg file has the same path within it.
I tried two separate plugins, both which work on the command line, and the result is the same error.
The error indicates the file location is incorrect, however the plugin is in the specified directory and runs with no errors within that directory.
I am totally stumped and appreciate any help.
For anyone reading this, I solved the problem.
The first time I added the plugin, I forgot to add the python extension. When I updated the already created plugin, Nagios still threw the error.
Once I completely deleted the plugin and re-created it the 'file not found', error went away.
I faced a similar issue when I was trying to add a custom plugin ( I had custom plugins in ruby and python ).
The issue was the missing shebang line at the start of the script (which determines the script's ability to be executed like a standalone executable).
For example, if you have a python plugin custom-plugin.py then make sure this script has shebang at the start of script #!/usr/bin/env python3. Also if you have other scripts (ruby, bash etc.) make sure to add the appropriate path at the start of your scripts.
Also, check the path for plugins Nagios version. For my setup path was /usr/local/nagios/libexec/ and make sure your custom plugin is executable and has correct ownership permissions.
Sample custom template I used :
define command {
command_name check_switch_health
command_line /usr/local/nagios/libexec/check_snmp.rb --host $HOSTADDRESS$ --model "$ARG1$" --community "$ARG2$"
}
The above workaround worked for me.

Mesosphere installation PermissionError:/genconf/config.yaml

I got a Mesosphere-EE, and install on fedora 23 server (kernel 4.4)with:
$bash dcos_generate_config.ee.sh --web –v
then output:
Running mesosphere/dcos-genconf docker with BUILD_DIR set to/home/mesos-ee/genconf
Usage of loopback devices is strongly discouraged for production use.Either use `--storage-opt dm.thinpooldev` or use `--storage-opt
dm.no_warn_on_loop_devices=true` to suppress this warning.
07:53:46:: Logger set to DEBUG
07:53:46:: ====> Starting DCOS installer in web mode
07:53:46:: DCOS Installer v1
07:53:46:: Starting server ('0.0.0.0', 9000)
Then I start firefox though vnc, the vnc is on root. then:
07:53:57:: Root page requested. 07:53:57:: Serving/usr/local/lib/python3.4/site-packages/dcos_installer/templates/index.html
07:53:58:: Request for configuration type made.
07:53:58::Configuration file not found, /genconf/config.yaml. Writing new onewith all defaults.
07:53:58:: Error handling request
PermissionError: [Errno 13] Permission denied: '/genconf/config.yaml'
But I already have a genconf/config.yaml, it look like:
bootstrap_url: http://<bootstrap_public_ip>:<your_port>
cluster_name: '<cluster-name>'
exhibitor_storage_backend: zookeeper
exhibitor_zk_hosts: <host1>:2181,<host2>:2181,<host3>:2181
exhibitor_zk_path: /dcos
master_discovery: static
master_list:
- <master-private-ip-1>
- <master-private-ip-2>
- <master-private-ip-3>
superuser_username: <username>
superuser_password_hash: <hashed-password>
resolvers:
- 8.8.8.8
- 8.8.4.4
I do not know what’s going on. If you have any idear, please let me know, thank you very much!
Disable Selinux!
Configure SELINUX=disabled in the /etc/selinux/config file and then reboot!
Be ensure the selinux is disabled by the command getenforce.
$ getenforce
Disabled
zhe.
Correctly installing the enterprise edition depends on the correct system prerequisites. Anyway I suppose you're still on the bootstrap node so I will give you some path to succed in your current task.
Run the script as root or as a user issuing sudo dcos_generate_config.ee.sh
The script will also generate the config file automatically; if you want to use your own configuration file then create a folder named genconf and put it inside before running the script. You should changes the values inside <> with your specific configuration. If you need more help for your specific case send me an email to infofs2 at gmail.com

Getting status information of check_mysql-health command in Nagios Core

Am using the NagiosQL to configure the Nagios core, i have a problem with check_mysql_health plugin it is not returning status information in Nagios core but if run same command in command-line it is gives the proper result. Can anyone suggest me some solution for this?
Thanks
Somesh
Finally i got the solution for my problem, to get the status information in Nagios core we have to set the path of the check_mysql_health plugin in 4 different config files /etc/nagios/command-plugin.cfg - add the plugin path,/etc/nagios/nrpe.cfg - add the plugin path, /etc/nagiosql/commands.cfg - add the plugin path at command definition, /etc/nagios/objects/commands.cfg - define the command for check_mysql_health, and the Additional templates must be a generic templates in service panel of NagiosQL

Ushahidi No Input File Specified

I have been trying to install Ushahidi platform for weeks but without any luck. I recently started over using Ushahidi latest release ushahidi-Ushahidi_Web-2.0.1-140-g0991172.zip and extracted it to folder ushahidi under my root.
I am using godaddy Linux server. I have tried both the manual and wizard to setup Ushahidi. In all cases, after installation, I get the same error when I try to access admin page. The error reads:
No input file specified.
I have tried tried installing using the wizard and the manual process. My PHP version is as required.
Any help will be appreciated. I need it to work so I can move on and customize it. Very disappointing such a good open source tool has poor installation guides!
Thanks.
Sting
there are a few things that can trip up following the installation.
Make sure that:
mod_rewrite is turned on in apache "a2enmod rewrite"
AllowOverride All is set in your apache config for your site (/etc/apache2/sites-available/default)
your .htaccess file points to the correct webroot

Resources