Monitoring website content through VPN connection

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
awbornman
Posts: 16
Joined: Fri Feb 19, 2016 1:46 pm

Monitoring website content through VPN connection

Post by awbornman »

Hello Team,

How can I monitor a website's text content through a VPN connection?

An idea I have been trying so far is:

[root@2605 libexec]# ./check_vpn_master_test_1 -t pptp -H xxx.xx.10.46 -u <username> -p <password> -- require-mppe; ./check_http_content -U http://10.103.37.210/specialcalls.php -m "Communication Warning" -t 5
OK: VPN to 'xxx.xx.10.46' up and running on 'ppp0', 'http://10.103.37.210/specialcalls.php' reachable|time=0.053s;size=5138B
ERROR: CANNOT RETRIEVE URL: 500 Can't connect to 10.103.37.210:80 (timeout)

Is anyone aware of a plugin that utilizes a VPN connection before checking a website? The issue I am having is that the VPN check disconnects before checking the site contents-

Thank you!
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Monitoring website content through VPN connection

Post by hsmith »

Can you set a higher timeout in the plugin?
Former Nagios Employee.
me.
awbornman
Posts: 16
Joined: Fri Feb 19, 2016 1:46 pm

Re: Monitoring website content through VPN connection

Post by awbornman »

I set the timeout to 300 seconds- I should start by asking if the ';' maintains the same check or just starts a new check?

[root@2605 libexec]# ./check_vpn_master_test_1 -t pptp -H xxx.xx.10.46 -u <username> -p <password> -- require-mppe; ./check_http_content -U http://10.103.37.210/specialcalls.php -m "Communication Warning" -t 300
OK: VPN to 'xxx.xx.10.46' up and running on 'ppp0', 'http://10.103.37.210/specialcalls.php' reachable|time=0.043s;size=5143B
ERROR: CANNOT RETRIEVE URL: 500 Can't connect to 10.103.37.210:80 (Connection timed out)
awbornman
Posts: 16
Joined: Fri Feb 19, 2016 1:46 pm

Re: Monitoring website content through VPN connection

Post by awbornman »

I tried this with another check - is this correct? The check comes back good but never reports the string:

define service{
use generic-service
host_name W Des Moines IA VPN
service_description W Des Moines xxxx Status Check TEST TEST TEST
check_command check_vpn_WD_IA_TOC!pptp!<username>!<password>!require-mppe!; ./check_http -H 10.103.13.242 -f follow -u "/service/status/inspire" -s "FAIL"
}

returns:

OK: VPN to 'xxx.xx.10.46' up and INSPIRE is running on 'ppp0', 'http://10.103.33.242' INSPIRE Status reachable
awbornman
Posts: 16
Joined: Fri Feb 19, 2016 1:46 pm

Re: Monitoring website content through VPN connection

Post by awbornman »

Or how can I use the website defacement wizard through a vpn connection?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Monitoring website content through VPN connection

Post by rkennedy »

Are you using check_http or check_http_content? Just trying to understand the differences here. The default check_http plugin will be able to match strings with the -s parameter.
Former Nagios Employee
awbornman
Posts: 16
Joined: Fri Feb 19, 2016 1:46 pm

Re: Monitoring website content through VPN connection

Post by awbornman »

I have tried both, I need a way to check strings once connected to a vpn-

The website defacement plugin would be beyond perfect if I could connect to the vpn first.

Is there a way to combine checks? For example run my check_vpn and any http string check at the same time?


Thank you!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Monitoring website content through VPN connection

Post by rkennedy »

You could create a wrapper script, that connects to the VPN first, and then executes the check_http plugin statically in it. Then, assign this wrapper script as a command, and assign it to the service.
Former Nagios Employee
awbornman
Posts: 16
Joined: Fri Feb 19, 2016 1:46 pm

Re: Monitoring website content through VPN connection

Post by awbornman »

Thank you!

Would you happen to have an example that I could see?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Monitoring website content through VPN connection

Post by rkennedy »

Something like -

Code: Select all

!#/bin/bash
openvpn --config vpn.ovpn --auth-usuer-pass file.txt
/usr/local/nagios/libexec/check_http <your parameters>
This would run through the openvpn command first, and then execute the check_http after doing so.
Former Nagios Employee
Locked