![]() ![]() 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. 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 In summary, we have list of commands to be executed remotely and get the output file with log. #!/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. The returned data for standard SSH Script sensors must be in the following format: The expected return format for the scripts used with the SSH Script sensor is documented in the PRTG Manual: Application Programming Interface (API) Definition. If you already had aliases named k and xr, you can name your new ones anything you want.This article applies as of PRTG 22 SSH Script sensor Note that the exact names of these aliases aren’t important. Next, create an alias for logging into rice.Īlias xr='ssh -Y x is for X, and the r is for rice. This creates an alias for logging into Kerberos. We recommend listing your aliases in alphabetical order. Now, add the following line to the alias section of your. You can edit this file from RStudio by running bash_profile.Īliases (for Zsh) live in your. If you are using the Bash shell, instead edit. You can create a Windows Terminal profile that does this on startup by adding the commandline setting to a profile in your settings.json file inside the list of profile objects. In the following, we’ll assume that you are using the Zsh shell and edit. Copy files and run commands through SSH Linux Windows Connecting to the server via SSH is one of the primary means for managing nix servers. You can start an SSH session in your command prompt by executing ssh usermachine and you will be prompted to enter your password. Possible results include /bin/zsh for the Zsh shell and /bin/bash for the Bash shell. Now, we’ll create aliases for logging into Kerberos and rice. 10.2.3 Add a remote for the original repository.9.2.2 More resources on asking good questions. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |