oreorec.blogg.se

Ssh shell scripting
Ssh shell scripting










ssh shell scripting

The form of that command is the following: ssh The most basic use of SSH is to connect to a remote host for a terminal session. SSH also replaces file transfer programs, such as File Transfer Protocol (FTP) and rcp (remote copy). SSH enables the same functions - logging in to and running terminal sessions on remote systems. Secure Shell was created to replace insecure terminal emulation or login programs, such as Telnet, rlogin (remote login) and rsh (remote shell). An SSH server, by default, listens on the standard Transmission Control Protocol (TCP) port 22. SSH can also be used to create secure tunnels for other application protocols, for example, to securely run X Window System graphical sessions remotely. SSH implementations often include support for application protocols used for terminal emulation or file transfers. SSH uses the client-server model, connecting a Secure Shell client application, which is the end where the session is displayed, with an SSH server, which is the end where the session runs. SSH refers both to the cryptographic network protocol and to the suite of utilities that implement that protocol. In addition to providing strong encryption, SSH is widely used by network administrators to manage systems and applications remotely, enabling them to log in to another computer over a network, execute commands and move files from one computer to another.

#SSH SHELL SCRIPTING PASSWORD#

Secure Shell provides strong password authentication and public key authentication, as well as encrypted data communications between two computers connecting over an open network, such as the internet. SSH also refers to the suite of utilities that implement the SSH protocol. Click on "Create".SSH, also known as Secure Shell or Secure Socket Shell, is a network protocol that gives users, particularly system administrators, a secure way to access a computer over an unsecured network. You may also configure other options too depends on your need. Under the drop down menu you will find all scripts which you placed on target Linux machine. Now come to PRTG console and add a sensor name "ssh script" under your Device, then here you click on "Script box" drop down menu and select httpd.sh script which you placed earlier. Give executable permission and disable the firewall & SElinux temporary In our case we select port 80 as we need to monitor web service on target Linux machine. Now modify "Port" as per your process requirement.

ssh shell scripting

Suppose we made a file httpd.sh so its like /var/prtg/scripts/httpd.sh. Copy the script mentioned in first response under below linkĪnd paste in to a file with your preferred name. On target machines where you want to monitor the Linux script. I am able to use this script to monitor Redhat Linux process. OpenPorts=$($NETSTAT -tulpn | grep -vE '^Active|Proto' | grep 'LISTEN' | awk '' | sed '/^$/d' | sort -u)Įcho "0:200:$service is running." # returncode 0 = put sensor in OK statusĮcho "1:404:$service is not running." # returncode 1 = put sensor in WARNING status #!/bin/bashĮcho "4:500:You have to be root to run $0." # returncode 4 = put sensor in DOWN statusĮcho "2:500:id not found." # returncode = 2 = put sensor in DOWN status This example script will run on the target host and check if a service on a specific port is running. Protocol Error (for example a web server returns a 404)Ĭontent Error (for example a web page does not contain a required word) System Error (for example a network/socket error) The SSH script's "returncode" has to be one of the following values: Value Value must be a 64-bit integer or float and will be used as the resulting value for this sensor (for example bytes, milliseconds, etc.), message can be any string and will be stored in the database.

ssh shell scripting

The returned data for standard SSH Script sensors must be in the following format:

ssh shell scripting

The expected return format for the scripts used with the SSH Script sensor is documented in the PRTG Manual: Application Programming Interface (API) Definition. This article applies as of PRTG 22 SSH Script sensor












Ssh shell scripting