Page 1 of 4
Esensors Websensor
Posted: Wed Dec 07, 2016 8:23 am
by bashar.abed
Hi,
I have Nagios sytem Version 5.3.3 VM, I connected new device to check Humidity and Illumination Temperature in our Data Center,the name of device is Esensors EM08-T version PR3x8.1.2 , i using Configuration Wizards --> Esensors Websensor ,after that i have a problem when i finished the Wizards setps as attached file
Run Check Command result for Humidity
[nagios@nms. ~]# /usr/local/nagios/libexec/check_em08 10.x.x.x H 15 80 10 90
Run Check Command result for Illumination
[nagios@nms. ~]# /usr/local/nagios/libexec/check_em08 10.x.x.x I x 70 x 80
Run Check Command result for Temperature
[nagios@nms. ~]# /usr/local/nagios/libexec/check_em08 10.x.x.x T 60 85 50 95
result from Nagios root
[nms ~]$ /usr/local/nagios/libexec/check_em08 10.x.x.x T 60 85 50 95
-bash: /usr/local/nagios/libexec/check_em08: No such file or directory
and please see the below result when i search the file check_em08 from libexec
[@nms ~]$ cd /usr/local/nagios/libexec/
[@nms libexec]$ ls -ltr
-rwxrwxr-x 1 apache nagios 5576 Oct 18 10:08 check_em01.pl
Thanks
Re: Esensors Websensor
Posted: Wed Dec 07, 2016 9:01 am
by bashar.abed
Hi,
and please see the below result for Nagios Root
[root@nms libexec]# ./check_em01.pl 10.x.x.x --type=temp --temp=65/75,60/80
Unable to read sensor
Re: Esensors Websensor
Posted: Wed Dec 07, 2016 11:02 am
by rkennedy
What version of the wizard are you running? I just checked on my system, and it created a file called check_em01.pl with the command definition as below -
Code: Select all
check_em01_light $USER1$/check_em01.pl --type=illum --illum=$ARG1$,$ARG2$ $HOSTADDRESS$
It looks like the file you were attempting was check_em08, so just trying to see if something is invalid. As for this, please try running it with --debug appended -
Code: Select all
./check_em01.pl 10.x.x.x --type=temp --temp=65/75,60/80 --debug
Then post back the result for us.
Re: Esensors Websensor
Posted: Wed Dec 07, 2016 1:25 pm
by bashar.abed
Hi,
please see the below result after applied the commands
[root@nms libexec]# ./check_em01.pl 10.x.x.x --type=temp --temp=65/75,60/80 --debug
connected to 10.x.x.x:80
timeout(alarm) during sensor read
Unable to read sensor
What version of the wizard are you running? how can do that ?
Re: Esensors Websensor
Posted: Wed Dec 07, 2016 3:34 pm
by lmiltchev
Did you enable the plugin by running the following command from the command line:
Code: Select all
gcc /usr/local/nagiosxi/html/includes/configwizards/esensors-websensor/plugins/check_em08.c -o /usr/local/nagios/libexec/check_em08
as described in our
documentation?
Re: Esensors Websensor
Posted: Thu Dec 08, 2016 1:28 am
by bashar.abed
Hi,
when I applied this command ,i saw this message
gcc /usr/local/nagiosxi/html/includes/configwizards/esensors-websensor/plugins/check_em08.c -o /usr/local/nagios/libexec/check_em08
[nagios@nms. ~]# /usr/local/nagios/libexec/check_em08 10.x.x.x H 15 80 10 90
Invalid data received.
Re: Esensors Websensor
Posted: Thu Dec 08, 2016 10:38 am
by rkennedy
Based on what the plugin is doing, it appears to be looking at index.html -
Code: Select all
print $remote "GET /index.html?em345678 HTTP/1.1 \r\n";
Let's take a look at what's being seen. Please run the following -
Code: Select all
curl 10.x.x.x/idnex.html?em345678 -v
(replace 10.x.x.x with the proper IP)
Then post this back here for us to look at.
Re: Esensors Websensor
Posted: Fri Dec 09, 2016 7:18 am
by bashar.abed
Hi,
after applied this commands the result is
curl 10.x.x.x/idnex.html?em345678 -v
[root@nms ~]# curl 10.x.x.x/idnex.html?em345678 -v
* About to connect() to proxy 10.y.x.x port 8080 (#0)
* Trying 10.y.x.x... Connection timed out
* couldn't connect to host
* Closing connection #0
curl: (7) couldn't connect to host
the proxy IP is incorrect, how can change it to correct one
Re: Esensors Websensor
Posted: Fri Dec 09, 2016 10:47 am
by rkennedy
That's most likely the issue. Take a look at this article which should help to resolve the proxy -
https://support.nagios.com/kb/article.php?id=147
Re: Esensors Websensor
Posted: Mon Dec 12, 2016 6:03 am
by bashar.abed
Hi,
please see the below result
[root@nms ~]# curl IP-sensor/idnex.html?em345678 -v
* About to connect() to proxy IP-Proxy port 8080 (#0)
* Trying IPProxy... connected
* Connected to IP-Proxy (IP-Proxy) port 8080 (#0)
> GET
http://IP-sensor/idnex.html?em345678 HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: IP-sensor
> Accept: */*
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 403 Forbidden
< Content-Length: 1393
<
<!-- IE friendly error message walkround.
if error message from server is less than
512 bytes IE v5+ will use its own error
message instead of the one returned by
server. -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">html,body{height:100%;padding:0;margin:0;}.oc{display:table;width:100%;height:100%;}.ic{display:table-cell;vertical-align:middle;height:100%;}div.msg{display:block;border:1px solid #30c;padding:0;width:500px;font-family:helvetica,sans-serif;margin:10px auto;}h1{font-weight:bold;color:#fff;font-size:14px;margin:0;padding:2px;text-align:center;background: #30c;}p{font-size:12px;margin:15px auto;width:75%;font-family:helvetica,sans-serif;text-align:left;}</style><title>Access Denied</title></head><body><div class="oc"><div class="ic"><div class="msg"><h1>Access Denied</h1><p>The page you requested has been blocked by a firewall policy restriction.</p></div></div></div></body></html>
* Connection #0 to host IP-Proxy left intact
* Closing connection #0