Pages

Saturday, April 22, 2017

Python script to monitor server,ports,Oracle Database ,website with email alerts



Python script to monitor server,ports,Oracle Database ,website with email alerts


Script location :




1. create server.txt



    vi server.txt


Format






## PING to ping server
#### PING <ServerName> <IP> <EmailIDs to alert> ## multiple IP can be provided with ","
## PING PORT , it will ping to port with server
#### PINGPORT <ServerName> <IP:PORT> <EmailIDs to alert>
## JDBCORCL to ping oracle DB using jdbc driver
#### JDBCORCL <DB INSTANCE> <IP:1521:orcl,Schename,Password> <EmailIDs to alert>
## URLPING to make http connection to URL
#### URLPING <ServerName> <URL> <EmailIDs to alert>





2. Create the message for alert email

Example :

HTML tags will work fine .














3. it uses JDBC driver for database connection . Make sure that java installed on the system to make DB connection .


https://github.com/sterin501/PythonScripts/tree/master/MonitorScirpt/oracleDBConn




4. Add the script in crontab with monitor period