Build precise queries to find exactly what you need
Press ESC to close
Your review has been submitted and is pending approval.
Check VPN tunnel availability in AWS.
Current Version
1
Last Release Date
December 15, 2016
Owner
Tony jafar
License
GPL
Compatible With
#!/usr/bin/python import boto import boto.ec2 import boto.vpc import sys if len(sys.argv) < 4: print('Usage: check_vpn.py <IP1> <IP2> <Region>') sys.exit() IP1 = sys.argv[1] IP2 = sys.argv[2] ec2_region = sys.argv[3] aws_access_key_id = <KEY> aws_secret_access_key = <Secret> def test_vpc_status(): ec2_conn = boto.vpc.connect_to_region(ec2_region, aws_access_key_id= aws_access_key_id, aws_secret_access_key=aws_secret_access_key) x = [] for vpn_connection in ec2_conn.get_all_vpn_connections(): for tunnel in vpn_connection.tunnels: if tunnel.outside_ip_address == IP1 or tunnel.outside_ip_address == IP2: name = vpn_connection.id x.append(tunnel.status) if 'UP' in x: print('Ok - at least one tunnel is UP in ' + name) sys.exit(0) else: print('Critical - there is no up tunnels in ' + name) sys.exit(2) if __name__ == "__main__": test_vpc_status()
You must be logged in to submit a review.
To:
From:
We’ve completely redesigned the world’s largest repository of Nagios plugins and monitoring tools. Join thousands of users sharing monitoring solutions for servers, applications, and everything in between.
Due to our redesign, all existing accounts require a password reset to access your account again.
Ready to explore 6,100+ projects and contribute to the community?
Reset Password Create Account
Happy Monitoring!