Sponsored Content
Top Forums Shell Programming and Scripting writing a simple script to get total number of cpus/cores in server Post 302591726 by steven12 on Friday 20th of January 2012 11:35:47 AM
Old 01-20-2012
Hi Corona,
Code:
 
awk -F: '/^physical/ && !ID[$2] { P++; ID[$2]=1 }; /^physical/ { N++ };  END { print N, P }' /proc/cpuinfo

thanks for the above script. It shows the right information but how can we add comments to it so that we can understand what it is displaying?

eg output of above script.

16 4 -->script displays as this but how we add comments to this such that it will show

total cores =16 and cpus =4

thanks,
steve.

Last edited by vbe; 01-20-2012 at 01:34 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Need help writing simple script

I'm trying to write a simple unix script that will delete files after 30 days of being created. I've never done this before but conceptually it sounds easy. Here is what I'm trying to do: Get System Date Get File Date If (sysdate-filedate>30days) rm file All of these files are contained... (1 Reply)
Discussion started by: tamdoankc
1 Replies

2. UNIX for Dummies Questions & Answers

HELP! writing simple shell script

how would i write a shell script to show the number of lines in which int variable appears in a c++ program. (3 Replies)
Discussion started by: deadleg
3 Replies

3. Shell Programming and Scripting

Need Script to Use CPUs on a HPUX server to simulate Workload Manager on HPUX.

I am running HPUX and using WLM (workload manager). I want to write a script to fork CPUs to basically take CPUs from other servers to show that the communication is working and CPU licensing is working. Basically, I want to build a script that will use up CPU on a server. Any ideas? (2 Replies)
Discussion started by: cpolikowsky
2 Replies

4. Shell Programming and Scripting

Help with writing simple bash script

I want to write a bash script to: 1. Send an email from localhost to an external gmail account. (gmail then automatically forwards the message back to a pop account on the same server. 2. Script waits 3 minutes then checks to see if the email arrived, and if not, it sends an email to... (9 Replies)
Discussion started by: sallyanne
9 Replies

5. Shell Programming and Scripting

problem writing a simple c shell script

#!/bin/csh echo hello world this is what i got in a text file called ss1. i type "chmod 755 ss1.txt" to make it executable. then when i type ss1 or ss1.txt it says "ss1 command not found" what am i doing wrong? (19 Replies)
Discussion started by: pantelis
19 Replies

6. Shell Programming and Scripting

Total number of users logged in a server from uptime

how to find out total number of users logged in a server from uptime . i mean to say i need the total output of unix command . who gives the out put at a particular time . I need at all time from which machine who has connected , (3 Replies)
Discussion started by: amiya.te@gmail
3 Replies

7. UNIX and Linux Applications

Looking to reduce the number a cpus available for SGE

Hey all Im looking to reduce the number of cpus available on a certain node in our cluster available for jobs using SGE. i.e. we have one node that has 24 cpus available for jobs on SGE, i would like to reduce that to 16. Thanks (1 Reply)
Discussion started by: olifu02
1 Replies

8. Red Hat

Control Cores/CPUs used in Linux instance on VMware

We have a production setup where we have RHEL instances on VMware. We have 2 RHEL instances on VMware now each having 4 CPUs/cores each. I want to put up another RHEL instance but my query is that can we allocate only 1 CPU/core for the new instance. I hope, my query is clear that can we... (3 Replies)
Discussion started by: RHCE
3 Replies

9. Solaris

How to calculate total number of cores on my servers ?

Hi, I want to get total number of cores on my all non-global zones on Solaris 10. I got two methods and both are giving different results. Below link is a script, which tells me that total cores are 8 Mandalika's scratchpad: Oracle Solaris: Show Me the CPU, vCPU, Core Counts and the... (4 Replies)
Discussion started by: ron323232
4 Replies

10. Solaris

Calculating number of CPUs in Solaris-8

Hello, I have few old V210/V240, running Solaris-8. I am trying to find, number of physical CPUs, number of cores and number of virtual processors. psrinfo is giving me confusing status. It looks like, there are 2 physical CPUs, but psrinfo -p shows me just 1 bash-2.03$ psrinfo -v Status of... (4 Replies)
Discussion started by: ron323232
4 Replies
STUD(8) 						    BSD System Manager's Manual 						   STUD(8)

NAME
stud -- The Scalable TLS Unwrapping Daemon SYNOPSIS
stud [--tls] [--ssl] [-c ciphers] [-b host,port] [-f host,port] [-n cores] [-r path] [-u username] [--write-ip] [--write-proxy] certificate.pem DESCRIPTION
stud is a network proxy that terminates TLS/SSL connections and forwards the unencrypted traffic to some backend. It's designed to handle 10s of thousands of connections efficiently on multicore machines. stud has very few features -- it's designed to be paired with an intelligent backend like haproxy or nginx. It maintains a strict 1:1 con- nection pattern with this backend handler so that the backend can dictate throttling behavior, maxmium connection behavior, availability of service, etc. The only required argument is a path to a PEM file that contains the certificate (or a chain of certificates) and private key. It should also contain DH parameter if you wish to use Diffie-Hellman cipher suites. The options are as follows: --tls Use TLSv1 (default). --ssl Use only SSLv3 and no TLSv1. -c ciphers Set allowed ciphers using the same format as openssl ciphers. For example, you can use RSA:!COMPLEMENTOFALL. -b host,port Define backend. Default is 127.0.0.1,8000. Incoming connections will be unwrapped and sent to this IP and port. -f host,port Define frontend. Default is *,8443. Incoming connections will be accepted to this IP and port and will be sent to the backend defined above. -n cores Use cores worker processes. Default is 1. -r path Chroot to the given path. By default, no chroot is done. -u username Set GID/UID after binding the socket. By default, no privilege is dropped. --write-ip Write 1 octet with the IP family followed by the IP address in 4 (IPv4) or 16 (IPv6) octets little-endian to backend before the actual data. --write-proxy Write HaProxy's PROXY (IPv4 or IPv6) protocol line before actual data. SEE ALSO
ciphers(1SSL), dhparam(1SSL), haproxy(1) AUTHORS
stud was originally written by Jamie Turner (@jamwt) and is maintained by the Bump server team. It currently provides server-side TLS termi- nation for over 40 million Bump users. BSD
September 23, 2011 BSD
All times are GMT -4. The time now is 08:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy