Skip to content

This code allows us to communicate to a WS as a client, get it's state, UP or DOWN. Outputs it's status when it changes to the console and notifies us on telegram.

License

Notifications You must be signed in to change notification settings

Saul-Marques/Web-Server-Availability-Test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Web-Server-Availability

This code allows us to communicate to a WS as a client, get it's state, either UP or DOWN. Outputs it's status when it changes to the console and notifies us on telegram.

Feel free to edit the code's necessary params to your needs

Instalation and compilation

Clone the repository

Compile the files either using the makefile file(lol)

or

gcc Availability_Eval.c -o Availability_Eval
gcc WS_Client.c -o WS_Client

Before Compiling

Change the line 24 on the 'Availability_Eval.c' file to meet your telegram bot's and profile ChatID params

// Send a notif to a telegram bot. Change this URL to your use case.                           Change the chat ID to your own personnal chatID
            system("curl -s -X POST https://api.telegram.org/bot123456789101112123/sendMessage -d chat_id=12345678 -d text=\"Server is Down!\"");

You should also change the server's IP on the file WS_Client.c to meet your needs

serverAddress.sin_port = htons(80); // Define the port
    serverAddress.sin_addr.s_addr = inet_addr("127.0.0.1"); //This is the server's IP address

Usage

On the Linux terminal

./WS_Client | ./Availability_Eval

License

MIT

About

This code allows us to communicate to a WS as a client, get it's state, UP or DOWN. Outputs it's status when it changes to the console and notifies us on telegram.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages