I need to get some information form the cisco device. It is cisco-ios-xe device - cisco

I have a CISCO device. The device is configured with the WebUI. Which have many details? But I am not able to get these following details from there.
CPU Load
Temperature
Device details.
Memory use
Alarms
I have tried many times to get those above define values. But not able to get any things, Please help.

Depending on the model & software version, the web UI can vary. You'll have better luck obtaining those details utilising CLI instead.
Whilst the CLI is fairly consistent between models/software versions, some commands might not be available. Consulting the Cisco documentation for your specific hardware & software revisions should help.
CPU Load
show processes cpu history
Will show you the CPU usage over 60 seconds, 1 hour and 72 hours.
show processes cpu
Will show you the running processes with the CPU utilisation over 5 seconds, 1 minute and 5 minutes.
Temperature
show environment all
show environment temperature
Outputs all the environmental conditions including power & temperature. You'll find the temperatures within the temperature section .
Device details.
show version
Displays the core information about your device & software. This includes the hardware details, IOS & ROM software versions, interfaces & memory, and system uptime/previous reload reason.
show inventory
Will output details about any additional hardware installed into your device, such as SFP, their type & serial numbers.
Memory use
show processes memory
Whilst show version shows you the total memory installed into your device, show processes memory shows you how it's being utilised, by which process, and how much is remaining.
show flash: / show bootflash
Will show you the files being stored into the flash memory, their sizes & how much space is left.
Alarms
show alarms / show facility-alarm status
If your equipment has an alarm indicator, the above commands will show advise you what's alarmed & the reasoning.

Related

Specify CPU frequency as a kernel CMD_LINE parameter of Linux on boot?

I replaced my i5 CPU of my laptop with a i7 CPU, so that it can run faster.
But because that the power of i7 is more, and the temperature is also higher than before, my laptop crashed frequently. So, I used cpupower to specify the MAX frequency of CPU, it works.
Now, my question is "Is there a way to specify the CPU frequency as a cmd_line parameter of the linux kernel, at boot time?", so I can ensure that the system has booted stably and correctly.
Btw, if new cpu runs under the freq of 2.5GHz at most, everything is ok, and the performance is twice more than the older. so I think it is worth to change my CPU.
thanks a lot!
UPDATE - 2018-11-25
Also, I want to mention that there are below commands to use CpuFreq subsystem without using any tool (like cpufrequtils as it is used to achieve the same purpose). Sometimes these tools lack features, or they simply don't work as we want. Because CpuFreq core creates a sysfs directory under /sys/devices/system/cpu/, some attributes are available as read-write to be changed at kernel level. These attribute changes are called as policies as CpuFreq has a Policy Interface in sysfs. Below commands should work at boot time and be persistent between boot times.
If scaling governor is selected as intel_pstate; (This part may help to avoid higher frequencies if intel_pstate is decided to be used)
Also turbo can be disabled because of wanting to prevent higher frequencies.
echo "1" | sudo tee /sys/devices/system/cpu/intel_pstate/no_turbo
After this, below command can be useful.
echo "70" | sudo tee /sys/devices/system/cpu/intel_pstate/max_perf_pct (70 can be changed by another percentage if clock speed and turbo speed is higher numbers. 70-80 should be enough to not reaching above 2.5 GHz)
This attribute is explained as below in https://www.kernel.org/doc/Documentation/cpu-freq/intel-pstate.txt and may help to decrement higher CPU frequencies.
max_perf_pct: Limits the maximum P-State that will be requested by the
driver. It states it as a percentage of the available performance.
Because P-States are operational states and by going Pn to P0, frequencies are increasing. So, limiting maximum P-states by percent of the maximum supported performance level can be useful. Check this link: https://software.intel.com/en-us/blogs/2008/05/29/what-exactly-is-a-p-state-pt-1
Also, in intel_pstate, CPUs share same properties. While using intel_pstate as scaling governor, per-CPU performance limits as cpufreq attributes (e.g. scaling_max_freq) can be used by adding below kernel parameter;
intel_pstate=per_cpu_perf_limits
Otherwise, CPUs can be set separately;
echo -n 2457600 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo -n 2457600 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
echo -n 2457600 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
echo -n 2457600 > /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq
But, there is an important part which is built-in script in Linux (/etc/init.d/ondemand). If ondemand or powersave is used as used as scaling governor, then configurations we set (like above) can collide with this script. The script should be disabled by below command;
sudo /usr/sbin/update-rc.d ondemand disable
Further info is in here: https://help.ubuntu.com/community/UbuntuStudio/Setting_CPU_Governor
After disabling ondemand, other scaling governors (like userspace, performance) can be set and be used by regarding above configuration.
These are all fundamental commands (both below and above part) and they should help solving CPU frequency scaling problem as I also wanted to give these information for future reference.
First of all, I want to give some information about CPU Frequency Scaling.
Three terms are related to this process (they are layers of a subsystem which is called as "CPU Performance Scaling") and they should be basically reviewed and discussed to ensure that everything is understood correctly.
CPUFreq Core
Scaling Driver
Scaling Governor
CPUFreq core is a basic framework and contains a common code infrastructure for all platforms that support this feature.
CPU frequency driver change CPU P-states that are managed by scaling governors and it communicates with hardware.
(P-States mean they are operational, in contrast of C-States, which they are idle states except C0 state. C0 state is also busy and active state.)
Scaling governors implement scaling algorithms.
By the way, CPU Performance Scaling is a deep topic and there are many things that should be considered. Basically, with the information above, below commands should meet your needs.
Firstly, I think intel_pstate is used as a scaling driver for now in your laptop. So, disabling it may provides us more advanced settings and more governors (intel_pstate has two governors that are powersave and performance). I think powersave is default governor for intel_pstate.
sudo vi /etc/default/grub
Add intel_pstate=disable to the GRUB_CMDLINE_LINUX_DEFAULT parameter.
GRUB_CMDLINE_LINUX_DEFAULT="intel_pstate=disable"
After adding the parameter execute below commands.
modprobe acpi-cpufreq
sudo update-grub
You can check kernel parameters at boot by below command
cat /proc/cmdline
By this way, acpi-cpufreq will be enabled as the scaling driver (because of disabling intel_pstate). So, the next thing can be setting governor as userspace to run the CPU as desired frequencies or letting it be as the default (ondemand should be default setting for acpi-cpufreq).
First Way of Setting Governor and Maximum Frequency Setting
If you want to change scaling governor (e.g. to userspace):
sudo update-rc.d ondemand disable (This command prevents above commands to be reset after reboot)
sudo apt install cpufrequtils (To control the CPU frequency scaling deamon)
echo 'GOVERNOR="userspace"' | sudo tee /etc/default/cpufrequtils
After these steps, we should have acpi-cpufreq as the scaling driver and ondemand (if you didn't change the governor) as the scaling governor. So, the last thing seem to be setting max frequency of the CPU.
Editing /etc/default/cpufrequtils like below should set CPU frequencies. If the file doesn't exist, create it.
MAX_SPEED="2457600"
MIN_SPEED="1536000"
Also check below lines in the same file.
ENABLE="true"
GOVERNOR="ondemand" (or userspace)
But, with this way, I think there is no guarentee for setting all CPU cores to the same frequency values. I saw some people say that below way (second way) set all CPU cores as their desired values but not first way.
Second Way of Setting Governor and Maximum Frequency Setting
Install tlp (Linux Power management tool)
sudo apt install tlp
After installing, edit /etc/default/tlp like below:
# Select a CPU frequency scaling governor: # ondemand, powersave,
performance, conservative # Intel Core i processor with intel_pstate
driver: # powersave, performance # Important: # You must
disable your distribution's governor settings or conflicts will #
occur. ondemand is sufficient for almost all workloads, you should
know # what you're doing! CPU_SCALING_GOVERNOR_ON_AC=ondemand
CPU_SCALING_GOVERNOR_ON_BAT=ondemand
# Set the min/max frequency available for the scaling governor. #
Possible values strongly depend on your CPU. For available frequencies
see # tlp-stat output, Section "+++ Processor".
CPU_SCALING_MIN_FREQ_ON_AC=0
CPU_SCALING_MAX_FREQ_ON_AC=0
CPU_SCALING_MIN_FREQ_ON_BAT=1536000
CPU_SCALING_MAX_FREQ_ON_BAT=2457600
Above settings should be kept after restarting or suspending the device.
I have tried to provide and explain ways to set the CPU frequency (also to keep settings persistent) and I may have forgotten something. So, please check the information above and try if these meet your needs. Also, you can use below command to ensure that everything is right.
cpufreq-info
Note: Please check below pages for more information.
Governors list
https://www.kernel.org/doc/Documentation/cpu-freq/governors.txt
https://www.kernel.org/doc/html/v4.14/admin-guide/pm/cpufreq.html
https://www.kernel.org/doc/html/v4.12/admin-guide/pm/intel_pstate.html
eventually I have time to reply this because I'm busy for doing other things.
I tried all of above solutions, and choosed "tlp + lm-sensors + psensor".
The following is my opinions:
cpupower is a simple but relatively poor of features tool, it only can set the MAX/MIN frequenc of CPU and the governor.
cpufrequtils is basically same as cpupower, except that it base on
acpi drivers, not the Intel genuin one. I guess a Intel genuin
driver with p_state support should be better choice for Intel CPU.
tlp is my choice at last, it has more features to monitor/throttle
the temperature and frequence of CPU, and more configurable options.
Yes, as Erdem Savasci said, with tlp the MAX/MIN freqs of all CPU cores can be set within one step, while those can NOT do with cpufrequtils.
In addition, I installed the lm-sensors and psensor. The former can be think as a driver for querying the temperature/frequence/Fan-speed, the latter is a GUI panel that can show information as above mentioned.
With these tools, I belive that my cpu would be running stablly.
But the solution to "ensure CPU run stablly AT BOOT TIME" has not be found yet.
All of above are started after boot, aren't they?
Sorry for my poor english, I'm a Chinese. Hope I has expressed correctly things.
Thanks again!

Reduction of GPP monitoring process

I will ask a question for the first time. I'm sorry if my manners were wrong.
I used RedHawkSDR v1.10.1 on embedded Linux on Xilinx Zynq.
AM demodulation processing is implemented with waveform connected three components.
When connecting the Ether and monitoring the waveform, since abnormal noise appears in the received sound,
We upgraded to RedHawkSDR v2.1.0.
GPP changed from python to C ++ and I thought that I could expect better performance.
However, when RedHawkSDR v2.1.0 was adopted, it became to be further strange.
Looking at the cause, GPP intensively operates every threshold_cycle_time,
Demodulation processing was not completed.
It seems that abnormal sound comes out at the timing when GPP acquires information such as CPU / NIC etc. and threshold is judged.
Is there any way to reduce or eliminate the GPP information acquisition process?
Environment is below.
CPU:Xilinx Zynq ARM CoretexA9 2cores 600MHz
OS:Embedded Linux Kernel 3.14 RealTimePatch
FrameLength:5.333ms(48kHz sampling, 256 data)
GPP scrapes /proc for all processes related to REDHAWK, providing you with a lot of information (through the utilization property) as well as better control regarding the state of the host. This process can be expensive on resource-limited systems (like the one you're using). You can change how often the update happens by changing the GPP's threshold_cycle_time.
If you add the elements:
<componentproperties>
<simpleref refid="threshold_cycle_time" value="2000"/>
</componentproperties>
to the GPP componentplacement element in the DCD, the threshold cycle time is increased from 500 milliseconds (the default) to 2 seconds. The number is an unsigned long, so you can increase this delay to over 4 million seconds
Note that if this threshold is set such that the state of the device does not get updated based on the state of the processor, it will never reach a BUSY state because of the processor use, so it will allow the deployment of applications over-subscribed computing hardware

How do I interpret the memory usage information from htop

We have multiple servers in our lab and I tried to determine which one has more resources currently available. I tried to interpret the information htop displays but I'm not 100% understanding all those numbers.
I have taken a screen shot for each server after issuing htop:
Server #1:
Server #2:
Does server #1 have more memory available than server #2? Should I look at Avg or Mem? Or what other parameter should I look at?
Thanks!
htop author here.
Does server #1 have more memory available than server #2?
Yes.
From the htop faq:
The memory meter in htop says a low number, such as 9%, when top shows something like 90%! (Or: the MEM% number is low, but the bar looks almost full. What's going on?)
The number showed by the memory meter is the total memory used by processes. The additional available memory is used by the Linux kernel for buffering and disk cache, so in total almost the entire memory is in use by the kernel. I believe the number displayed by htop is a more meaningful metric of resources used: the number corresponds to the green bars; the blue and brown bars correspond to buffers and cache, respectively (as explained in the Help screen accessible through the F1 key). Numeric data about these is also available when configuring the memory meter to display as text (in the Setup screen, F2).
Hope that clears things up! Cheers!

Thermal aware scheduler in linux

Currently i'm working on making a temperature aware version of linux for my university project. Right now I have to create a temperature aware scheduler which could take into account processor temperature and perform some scheduling. Is there any generalized way to get the temperature of the processor cores or can I integrate the coretemp driver with the linux kernel in any way ( I didn't find a way to do so on the internet ).
lm-sensors simply uses some device files exported by the kernel for CPU temperature, you can just read whatever these device files have as backing variables in the kernel to get the temperature information. In terms of a scheduler I would not write one from scratch and would start with the kernels CFS implementation and in your case modify the load balancer check to include temperature (currently it uses a metric that is the calculated cost of moving a task from one core to another in terms of cache issues, etc... I'm not sure if you want to keep this or not).
Temperature control is very difficult. The difficulty is with thermal capacity and conductance. It is quite easy to read a temperature. How you control it will depend on the system model. A Kalman filter or some higher order filter will be helpful. You don't know,
Sources of heat.
Distance from sensors.
Number of sensors.
Control elements, like a fan.
If you only measure at the CPU itself, the hard drive could have over heated 10 minutes ago, but the heat is only arriving at the CPU now. Throttling the CPU at this instance is not going to help. Only by getting a good thermal model of the system can you control the heat. Yet, you say you don't really know anything about the system? I don't see how a scheduler by itself can do this.
I have worked on mobile freezer application where operators would load pallets of ice cream, etc from a freezer to a truck. Very small distances between sensors and control elements can create havoc with a control system. Also, you want your ambient temperature to be read instantly if possible. There is a lot of lag in temperature control. A small distance could delay a reading by 5-15 minutes (ie, it take 5-15 minutes for heat to transfer 1cm).
I don't see the utility of what you are proposing. If you want this for a PC, then video cards, hard drives, power supplies, sound cards, etc. can create as much heat as the CPU. You can not generically model a PC; maybe you could with an Apple product. I don't think you will have a lot of success, but you will learn a lot from trying!

What is "Memory Page out Rate"

Could somebody please tell me what is "Memory Page Out Rate".
I have seen this in "HP Open View" server monitoring tool and tried googling it.
Would appreciate if some expert can clarify.
If page out rate is too high as 200+ per second, can it crash the server?
Thanks in advance
This link may help:
http://publib.boulder.ibm.com/infocenter/tivihelp/v15r1/index.jsp?topic=/com.ibm.itm.doc/main_unix65.htm
"Page Out Rate (KB per Second) The number of kilobytes that the virtual memory manager pages out per second averaged over the previous 30-second interval. Note: the value -1 indicates Not Available, -2 indicates Not Collected, 2147483648 indicates Value_Exceeds_Minimum, and -2147483647 indicates Value_Exceeds_Maximum."
A page-out rate of 200kb/s could be fine on some systems and service affecting on others. It all depends on how fast your disks/san can keep up.
To be honest you'd be better off asking this question in one of these more suitable sites, SO is for programming related questions, not sysadmin queries:
https://stackoverflow.com/questions/321618/where-can-i-ask-questions-that-arent-programming-questions
What you are referring to is the GBL_MEM_PAGEOUT variable of HP OVPM.
To my understanding it means that some process allocated memory and never de-allocated it, and that process is not currently active.
So basically it should be as low as possible.
However, according to the HP OVPM Metrics document, the definition is this:
GBL_MEM_PAGEOUT
PLATFORMS: HP-UX AIX NCR Sinix DEC SunOS Win3X/95
HP-UX AIX NCR Sinix DEC
The total number of page outs to the disk
during the interval. This includes pages paged out to paging space and
to the file system.
HP-UX
This metric is available on HP-UX 11.0 and beyond.
AIX
This is the same as the “page outs” value from the “vmstat -s”
command. Remember that “vmstat -s” reports cumulative counts.
This metric cannot be compared to the “po” value from the “vmstat”
command. The “po” value only reports the number of pages paged out to
paging space.
To determine the count (that is, GBL_MEM_PAGEOUT) for the current
interval, subtract the previous value from the current value. To
determine the rate (that is, GBL_MEM_PAGEOUT_RATE) for the current
interval, subtract the previous value from the current value and then
divide by the length of the interval. Keep in mind that whenever any
comparisons are made with other tools, both tools must be interval
synchronized with each other in order to be valid.
HP-UX SunOS
The total number of page outs to the disk during the
interval. This includes pages paged out to paging space and to the
file system.
Win3x/95
The total number of page outs to the disk during the interval
(Windows 95 only).

Resources