#Less proc cpuinfo
Explore tagged Tumblr posts
Text
Less proc cpuinfo

#LESS PROC CPUINFO DRIVER#
#LESS PROC CPUINFO FREE#
More Learning Resourcesįor product documentation, visit Oracle Help Center. Additionally, visit /learning-explorer to become an Oracle Learning Explorer.įor product documentation, visit Oracle Help Center. Why Here is the part of content in cpuinfo: processor : 0 vendorid : GenuineIntel cpu family : 6 model : 85 model name : Intel (R) Core (TM) i9-9980XE CPU 3.00GHz stepping : 4 microcode : 0x200005e cpu MHz : 1200.143 cache size : 25344 KB physical id : 0.
#LESS PROC CPUINFO FREE#
To immediately enable changes added to files in /etc/sysctl.d/.conf, run sysctl -p /etc/sysctl.d/.conf, providing the file name.Įxplore other labs on /learn or access more free learning content on the Oracle Learning YouTube channel. But it shows that the CPU has only 15 cores in /proc/cpuinfo as well as in htop.Values that are added to these files take effect each time the system boots.To preserve custom settings, add them to a /etc/sysctl.d/.conf file.Changes that are made by using both echo and sysctl are lost when the system is rebooted.Also where needed, enter “ q” to terminate output and return to the prompt.Īs the root user, use the ls command to display the contents of the /proc directory. Where needed, scroll through output using navigation keys such as Page Up and Page Down. In this section, you explore the proc file system (directory), view various files and directories that represent the current state of the kernel, and change the value of current settings. At the /etc/sysconfig/network entry, notice some of the variables initialized in this file.Continue to view the /etc/sysconfig entries in this file.Press n (lowercase for “next”) to display the next instance of the string.While viewing the file using the less command, use the slash ( /) key followed by etc/sysconfig to search for this string.Search the contents of the sysconfig.txt file for /etc/sysconfig. And, you make changes to files and observe the effect of the changes.Īs the root user, use the cd command to change to the /etc/sysconfig directory, and then use the ls command to explore the contents of it. You view documentation that describes the entries in the directory. You see that many initialization scripts derive values from files in the directory. The problem with the /proc/cpuinfo -based answers is that they parse information that was meant for human consumption and thus lacks a stable format designed. In this section, you explore the /etc/sysconfig directory and selected files in it. Note: When using the free lab environment, see Oracle Linux Lab Basics for connection and other usage instructions. A block volume in the same availability domain as the instances attached to one of the instances.Two fully patched Oracle Linux 8 instances.
#LESS PROC CPUINFO DRIVER#
View hardware device and device driver attributes.cpu family Authoritatively tells you the type of processor you have in the system. If you have more than one processor it will display all processor information separately counting the processors using zero notation. If you have one processor it will display a 0. This tutorial is targeted at users of Oracle Linux 8 or later. processor Provides each processor with an identifying number. The following tutorial provides step-by-step procedures to modify system configuration files, view and modify kernel settings, and discover hardware device and device driver attributes. x86info x86info is a program which displays a range of information about the CPUs present in an x86 system. This is the closet tool to CPU-Z app on Linux. cpuid command Dump CPUID information for each CPU. x86info command Show x86 CPU diagnostics. When completing your lab, substitute these values with ones specific to your cloud environment.Ĭonfigure System Settings on Oracle Linux Introduction lscpu command Show information on CPU architecture. It uses example values for Oracle Cloud Infrastructure credentials, tenancy, and compartments.This tutorial is available in an Oracle-provided free lab environment.Power management: ts ttp tm stc 100mhzsteps hwpstate Īnd i use 30 thread but the speed of my cracking is slow (19 m/s), i think that hashcat just use one of the Processor. Model name : Quad-Core AMD Opteron(tm) Processor 2344 HEįlags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc nonstop_tsc pni cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy altmovcr8 abm sse4a misalignsse 3dnowprefetch osvwĪddress sizes : 48 bits physical, 48 bits virtual See the result of this command : less /proc/cpuinfo :

1 note
·
View note
Text
Welcome to our guide on how to Monitor Apache Web Server with Prometheus and Grafana in less than 5 minutes. This setup should work for any version of Apache web server running on any flavor of Linux. We have other Prometheus Monitoring tutorials: Monitoring Ceph Cluster with Prometheus and Grafana How to Monitor BIND DNS server with Prometheus and Grafana Monitoring MySQL / MariaDB with Prometheus in five minutes If you are following this guide, I expect that you have Prometheus server installed and running, you can refer to our guide for a fresh installation of Prometheus server on Ubuntu or CentOS server. Install Prometheus Server on CentOS / Debian / Ubuntu Follow these setup steps to have your Apache Web Server metrics stored on Prometheus and visualized using Grafana. Step 1: Install Apache Prometheus exporter Install curl utility if not already present in your machine. ### Ubuntu / Debian ### sudo apt update && sudo apt install wget curl ### CentOS / RHEL / Fedora ### sudo yum -y install curl wget Check the latest release of Apache Prometheus exporter. curl -s https://api.github.com/repos/Lusitaniae/apache_exporter/releases/latest|grep browser_download_url|grep linux-amd64|cut -d '"' -f 4|wget -qi - Extract downloaded archive: tar xvf apache_exporter-*.linux-amd64.tar.gz sudo cp apache_exporter-*.linux-amd64/apache_exporter /usr/local/bin sudo chmod +x /usr/local/bin/apache_exporter Make sure apache_exporter is executable from your current SHELL: $ apache_exporter --version apache_exporter, version 0.11.0 (branch: HEAD, revision: c64b4496c4658d72c58fbda905a70c06a4b7f0c7) build user: root@2ec369d6fc9a build date: 20210729-10:04:27 go version: go1.16.6 platform: linux/amd64 Step 2: Create Apache exporter service First, add prometheus user which will run the service: sudo groupadd --system prometheus sudo useradd -s /sbin/nologin --system -g prometheus prometheus Then proceed to create a systemd service unit file: sudo vim /etc/systemd/system/apache_exporter.service Add below content: [Unit] Description=Prometheus Documentation=https://github.com/Lusitaniae/apache_exporter Wants=network-online.target After=network-online.target [Service] Type=simple User=prometheus Group=prometheus ExecReload=/bin/kill -HUP $MAINPID ExecStart=/usr/local/bin/apache_exporter \ --insecure \ --scrape_uri=http://localhost/server-status/?auto \ --telemetry.address=0.0.0.0:9117 \ --telemetry.endpoint=/metrics SyslogIdentifier=apache_exporter Restart=always [Install] WantedBy=multi-user.target The service will listen on port 9117, and metrics exposed on /metrics URI. If Apache metrics are not on http://localhost/server-status/?auto you’ll need to change the URL. With Init System For Init system like CentOS 6.x, create an init script under /etc/init.d/ sudo vim /etc/init.d/apache_exporter Add: #!/bin/bash # Author: Josphat Mutai, [email protected] , https://github.com/jmutai # apache_exporter This shell script takes care of starting and stopping Prometheus apache exporter # # chkconfig: 2345 80 80 # description: Prometheus apache exporter start script # processname: apache_exporter # pidfile: /var/run/apache_exporter.pid # Source function library. . /etc/rc.d/init.d/functions RETVAL=0 PROGNAME=apache_exporter PROG=/usr/local/bin/$PROGNAME RUNAS=prometheus LOCKFILE=/var/lock/subsys/$PROGNAME PIDFILE=/var/run/$PROGNAME.pid LOGFILE=/var/log/$PROGNAME.log DAEMON_SYSCONFIG=/etc/sysconfig/$PROGNAME # GO CPU core Limit #GOMAXPROCS=$(grep -c ^processor /proc/cpuinfo) GOMAXPROCS=1 # Source config . $DAEMON_SYSCONFIG start() if [[ -f $PIDFILE ]] > /dev/null; then echo "apache_exporter is already running" exit 0 fi echo -n "Starting apache_exporter service…" daemonize -u $USER -p $PIDFILE -l $LOCKFILE -a -e $LOGFILE -o $LOGFILE $PROG $ARGS RETVAL=$?
echo "" return $RETVAL stop() ! kill -0 $(cat "$PIDFILE"); then echo "Service not running" return 1 fi echo 'Stopping service…' #kill -15 $(cat "$PIDFILE") && rm -f "$PIDFILE" killproc -p $PIDFILE -d 10 $PROG RETVAL=$? echo [ $RETVAL = 0 ] && rm -f $LOCKFILE $PIDFILE return $RETVAL status() kill -0 $(cat "$PIDFILE"); then echo "apache exporter service running..." echo "Service PID: `cat $PIDFILE`" else echo "Service not running" fi RETVAL=$? return $RETVAL # Call function case "$1" in start) start ;; stop) stop ;; restart) stop start ;; status) status ;; *) echo "Usage: $0 stop" exit 2 esac Install daemonize package: sudo yum -y install daemonize Create Arguments configuration file: sudo vim /etc/sysconfig/apache_exporter Add: ARGS="--insecure --scrape_uri=http://localhost/server-status/?auto --telemetry.address=0.0.0.0:9117 --telemetry.endpoint=/metrics" Test the script: $ sudo /etc/init.d/apache_exporter Usage: /etc/init.d/apache_exporter start Step 3: Start Apache exporter service For Systemd: sudo systemctl daemon-reload sudo systemctl start apache_exporter.service sudo systemctl enable apache_exporter.service For Init systems without Systemd. sudo /etc/init.d/apache_exporter start sudo chkconfig apache_exporter on You can verify service status using: ### Systemd ### $ systemctl status apache_exporter.service ● apache_exporter.service - Prometheus Loaded: loaded (/etc/systemd/system/apache_exporter.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2021-09-01 10:12:33 UTC; 9s ago Docs: https://github.com/Lusitaniae/apache_exporter Main PID: 14652 (apache_exporter) Tasks: 6 (limit: 2340) Memory: 2.6M CPU: 5ms CGroup: /system.slice/apache_exporter.service └─14652 /usr/local/bin/apache_exporter --insecure --scrape_uri=http://localhost/server-status/?auto --telemetry.address=0.0.0.0:9117 --telemetry.endpoint=/metrics Sep 01 10:12:33 debian-bullseye-01 systemd[1]: Started Prometheus. Sep 01 10:12:33 debian-bullseye-01 apache_exporter[14652]: time="2021-09-01T10:12:33Z" level=info msg="Starting apache_exporter (version=0.10.0, branch=HEAD, revision=c64b4496c4658d72c58fbda905a70c> Sep 01 10:12:33 debian-bullseye-01 apache_exporter[14652]: time="2021-09-01T10:12:33Z" level=info msg="Build context (go=go1.16.6, user=root@2ec369d6fc9a, date=20210729-10:04:27)" source="apache_ex> Sep 01 10:12:33 debian-bullseye-01 apache_exporter[14652]: time="2021-09-01T10:12:33Z" level=info msg="Starting Server: 0.0.0.0:9117" source="apache_exporter.go:596" Sep 01 10:12:33 debian-bullseye-01 apache_exporter[14652]: time="2021-09-01T10:12:33Z" level=info msg="Collect from: http://localhost/server-status/?auto" source="apache_exporter.go:597" Sep 01 10:12:33 debian-bullseye-01 apache_exporter[14652]: time="2021-09-01T10:12:33Z" level=info msg="listening and wait for graceful stop" source="apache_exporter.go:601" ### Init System ### $ sudo /etc/init.d/apache_exporter status apache exporter service running... Service PID: 1970 Check service status: $ sudo chkconfig --list | grep apache_exporter apache_exporter 0:off 1:off 2:on 3:on 4:on 5:on 6:off Confirm the port is listening for requests. $ sudo ss -tunelp | grep 9117 tcp LISTEN 0 128 :::9117 :::* users:(("apache_exporter",1970,6)) ino:1823474168 sk:ffff880341cd7800 Step 4: Add exporter job to Prometheus Add a job to the Prometheus server for scraping metrics. Edit /etc/prometheus/prometheus.yml # Apache Servers - job_name: apache1 static_configs: - targets: ['10.1.10.15:9117'] labels: alias: server1-apache - job_name: apache2
static_configs: - targets: ['10.1.10.16:9117'] labels: alias: server2-apache Restart prometheus service for scraping to start sudo systemctl restart prometheus Test access to port 9117 from Prometheus server $ telnet 10.1.10.15 9117 Trying 10.1.10.15... Connected to 10.1.10.15. Escape character is '^]'. ^] Step 5: Add Dashboard to Grafana The final step is to create your own Dashboard for visualizing Apache metrics. For this demo, we’ll use Grafana Dashboards by Ricardo F. The dashboard ID is 3894. You should have Prometheus Data source already added to Grafana, or use the link Add Prometheus data source to add one. Once the data source has been added, Import Apache Grafana Dashboard by navigating to Dashboard > Import. Use 3894 for Grafana Dashboard ID. Give it a descriptive name and select Prometheus data source added earlier. Click “Import” button to start using the dashboard. After a few minutes, the metrics should start showing. Select a different host to show metrics for using the drop-down menu at the top of the metrics dashboard. In my next Apache monitoring guide, I’ll cover the use of InfluxDB and Grafana to monitor Apache Web server.
0 notes
Link
A simple script to prevent Raspberry Pi micro SD card cloning. It uses the CPU serial number as the unique ID for authentication. Use this script during boot up to check if the Raspberry Pi CPU serial number matches with the number hardcoded in the script. If the number does not match, then it will shut down Raspberry Pi. ----------------------script start------------------- #!/bin/bash cpuserial=`cat /proc/cpuinfo | grep Serial | cut -d ' ' -f 2` match=0 listofcpuserial=("000000004d754df1" "000000004d754df2" "000000004d754df3") for i in "${listofcpuserial[@]}" do if [ $i = $cpuserial ] then match=1 fi done if [ $match = 1 ] then echo "Sound Card State Restored" else echo "Sound Card State Not Restored" sudo halt -p fi -----------------script end---------------------- This script is just one part of the whole SD card cloning prevention. Next, you will need to compile this script into binary. By compiling this script into a binary program file, the file cannot be read by just using a text editor. To compile it into a binary program file;
shc -f ./script.sh
Note: you need to install shc first into your Raspberry Pi. Run this command:
sudo apt-get install shc
After compiling the script, name the binary program file into something less suspecting. After renaming, move the program to /lib/bin or /bin or any other locations that usually programs are located. The idea is to hide it there and blend it with the other programs. The final step is to start the program during startup. There are many ways to start the program during startup. Refer to this link to choose your poison: https://www.dexterindustries.com/howto/run-a-program-on-your-raspberry-pi-at-startup My recommendation is to hide your startup command within any existing startup script that the Raspberry Pi would have. This way it makes it hard to find it. Don't forget to delete any script left in the system. You don't want the source to be discovered. (via http://bit.ly/2P06FcI )
0 notes