date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,500,035,950,000 |
I want to check which process taking highest I/O. To be exact I want to check which process doing the highest write operation and how much.
I know there are some tools like iotop. But as I have to work without a sudo and a foreign environment with very limited privilege I want to know how can I achieve this with buil... |
The problem is that you do not have access to this information as ordinary user for other users' processes.
| Disk I/O per Process |
1,500,035,950,000 |
I would like to know how to monitor tcp traffic between my localhost and IP address keeping activities in a file. I tried iftop and tcptrack but I can not keep activities in a file. These tools don't target a specify IP address, they're monitoring the interface only :
iftop -i eth2 -f "dst port 22"
I tried to put t... |
As @blametheadmin mentioned in a comment, you can use tshark. Another option is tcpdump:
$ tcpdump -w trace.out host <hostname-or-ip>
Then later, you can examine that trace with:
$ tcpdump -r trace.out
| How to monitor tcp traffic between my localhost and IP adress |
1,500,035,950,000 |
I am wondering if someone might point me in the right direction. I've got little experience working with the Linux command line and recently due to various factors in work I've been required to gain knowledge.
Basically I have two php scripts that reside in a directory on my server. For the purposes of the applicati... |
I'd like to expand on Davidann's answer since you are new to the concept of a cron job. Every UNIX or Linux system has a crontab stored somewhere. The crontab is a plain text file. Consider the following: (From the Gentoo Wiki on Cron)
#Mins Hours Days Months Day of the week
10 3 1 1 * ... | Cron job to check if PHP script is running, if not then run |
1,500,035,950,000 |
If I run iostat -x 1 I saw ocassionally large 5MB to 10MB writes.
What files are being written?
I want to check the recently created files with size over 5MB for example.
How would I do so?
|
Find file modified within X minute under /path
find /path -cmin -X
Sign before minute:
+ more than X minutes / over X minutes
- less than X minutes / within X minutes
(no sign) exact
Example: find all files in /var/log (including sub-dir) modified within last 30min
find /var/log -cmin -30
Find file with ... | How to know recently updated files |
1,500,035,950,000 |
When the HDD indicator is blinking (for a long period), how could I know which process is taking most disk bandwidth?
|
Using iotop.
Iotop is a Python program with a top like UI used to show of behalf of which process is the I/O going on. It requires Python ≥ 2.5 (or Python ≥ 2.4 with the ctypes module) and a Linux kernel ≥ 2.6.20 with the TASK_DELAY_ACCT CONFIG_TASKSTATS, TASK_IO_ACCOUNTING and CONFIG_VM_EVENT_COUNTERS options on.
| Determine which process is taking most of disk bandwidth? |
1,500,035,950,000 |
In a networked environment, such as SOHO, is there any tools that can monitor the network bandwidth usage based on the computer's IP or mac address? So that we can know which user has the highest bandwidth usage. If possible also come out statistics of each computer usage based on IP or mac address.
|
iftop for a top like interface for instant view.
ntop for a lot of statistics with a web interface
argus ditto with a CLI interface.
See also iptstate on Linux to get the information tracked by the connection tracker.
| Tools that monitor the network bandwidth based on IP? |
1,500,035,950,000 |
Currently I need to have a program running all the time, but when the server is rebooted I need to manually run the program. And sometimes I'm not available when that happens.
I can't use a normal configuration to restart my program when the server is starting because I don't have root access and the administrator do... |
I posted this on a similar question
If you have a cron daemon, one of the predefined cron time hooks is @reboot, which naturally runs when the system starts. Run crontab -e to edit your crontab file, and add a line:
@reboot /your/command/here
I'm told this isn't defined for all cron daemons, so you'll have to check ... | how to ensure a program is always running but without root access? |
1,500,035,950,000 |
I have a linux server that apparently has two Intel Xeon X5670.
/proc/cpuinfo shows 12 CPUs but dmidecode shows only one CPU and the other one is in the Unpopulated status like it is showing that this is other CPU is because of the hyper threading.
My server is a HP Proliant DL380 G7 and it can have up to two CPUs.
My... |
If I read the datasheet correctly, you have one slot filled, six cores, which show as 12 processors because they are hyperthreading. (Also, /proc/cpuinfo should tell you about processor and physical id. The two parts of a hyperthreading core have the same physical id.)
This seems like a good read on the matter.
| How to identify if there is some power saving setting that powered down a processor in Linux |
1,500,035,950,000 |
Sometimes, I have a rogue Java process which takes up 100% of my CPU and makes it jump about 30C in temperature (usually resulting in a crash if not killed).
Problem is, I can never really identify it (its got a long list of parameters and stuff) or analyze it because I have to kill it so quickly.
Is there a sort of l... |
No, not by default. There is such a thing as too much logging (especially when you start risking logging the action of writing a log entry…).
BSD process accounting (if you have it, run lastcomm), if active, records the name of every command that is executed and some basic statistics, but not the arguments.
The audit ... | Is there a log of past threads that are now closed? |
1,500,035,950,000 |
Is there a command that relaunch the application once it finishes from the command line? Letting you do something like:
> relaunch python myapp.py
If not, then what's my best option? I know I could cron it, but I'd be more interested in something I could just execute from the terminal and that restarts at once. I'm o... |
You can try with a simple infinite loop:
while true; do
python myapp.py
done
Edit: the above is just a simple generic example. Most probably modifications are needed to take into account exit errors etc. For example:
until `python myapp.py; echo $?`; do
echo "exit ok, restarting"
done
| Relaunch application once finished |
1,500,035,950,000 |
I am looking for a convenient way to monitor my Ubuntu server from my laptop (running Ubuntu Desktop). I understand this is easily achievable by SSHing to the server and running commands, but I'd like to do it on the fly, without going through the process.
I'd like to see load graphs, processes, users, etc... just by... |
You can SSH to the server and run any console or GUI util.
To run GUI program, for example, gnome-system-monitor you need to ssh with -X option
-X Enables X11 forwarding. This can also be specified on a per-host
basis in a configuration file.
for instance,
ssh -X user@server
and then,
gnome-system... | Remote monitoring Linux server from Ubuntu workstation via SSH [closed] |
1,500,035,950,000 |
Is there an equivalent to the amazing systat command in Linux-based operating systems?
For those who don't know about it, the BSD's systat command is just amazing. It displays live graphs of network traffic, I/O, ICMP, IP, TCP, network sockets (like netstat), swap usage and so on. But the most amazing of all, is the -... |
someone just pointed me to Glances and while it still doesn't replace systat, it still pretty awesome. It collects the outputs of top, free, disk and network IO, and shows disk space usage, among other things. It can also run in client/server mode, both through a web interface or a dedicated remote commandline client ... | Is there an equivalent to systat in Linux? |
1,500,035,950,000 |
I monitor value from /proc/meminfo file, namely the MemTotal: number. It changes if a ram module breaks, roughly by size of the memory module - this is obvious.
I know the definition for the field from kernel documentation:
MemTotal: Total usable ram (i.e. physical ram minus a few reserved
bits and the kerne... |
I was not comfortable with having bug in kernel or a module, so I digged further and found out... that MemTotal can regularly change, downwards, or upwards. It is not a constant and this value is definitely modified by kernel code on many places, under various circumstances.
E.g. virtio_balloon kmod can decrease MemTo... | Why does MemTotal in /proc/meminfo change? |
1,500,035,950,000 |
I've got an AMDGPU on Linux and want to be able to see which processes are utilising my precious 4GB of VRAM I need for gaming.
I'd like this to be presented in a similar manner to top listing all processes utilising VRAM by usage.
radeontop only shows total VRAM usage.
|
One tool to accomplish this task is https://gitlab.freedesktop.org/tomstdenis/umr
sudo umr -t
Will start it in a top-like view. You can then hit v to see VRAM information per-process.
| How can I list AMDGPU VRAM usage by process? |
1,500,035,950,000 |
I have set-up an ELK server in testing environment. I intend to send log messages from different clients to ELK, but first i want to test it from localhost to verify it running properly.
Previously i had directly , used a python library to interact with elastic-search (since there was a problem in using urllib2 , 400... |
You could use logger with the -P switch to set your port to 5514.
Check man logger for other suitable switches, eg -t.
echo "access denied" | logger -t myservice -P 5514
To check if port 5514 is currently associated with logstash, lsof -i :5514, or check logstash startup logs (meta!). Are you certain your logstash is... | How to pipe a sample log message manually to logstash for processing |
1,500,035,950,000 |
We have ten servers in two groups servers, and there is a lot of traffic between those groups - too much we think. We know this because of stats of our provider, but don't know how this traffic is built up, and which servers cause this. There is no cluster or failover or anything - each server stands on its own.
I wo... |
I use a soft called IPTraf for quick monitoring of network connection.
It runs on the terminal and can give you divers stats on the current connections status on the machine it's installed.
you can also get a brake down based on the services used (or ports) which can be useful if your server only serves a particular ... | Lots of traffic between servers - where does it come from? |
1,500,035,950,000 |
I need to collect data about disk utilization for selected disks. I can use glance-plus monitoring tool to display the current data in percents (it looks similar to top), but I need to collect these values into a file so that I can create graphs from it.
Unfortunately this isn't possible in glance so I wanted to creat... |
Note that glance can be scripted:
# cat /opt/perf/examples/adviser/disk_sar
#The following glance adviser disk loop shows disk activity comparable
#to sar -d data.
#Note that values will differ between sar and glance because of differing
#data sources, calculation methods, and collection intervals.
header... | how can I retrieve disk IO utilization in percents on HP-UX |
1,500,035,950,000 |
The main server at my company has recently been having a lot of downtime. For reasons that neither I nor the other admins can determine, it has random (VERY sudden) explosions in memory. It becomes unresponsive because it exhausts all the memory, and then we have to reboot it. Very annoying. It's a Debian system, we h... |
atop is pretty good at monitoring and logging resource usage. It can be used interactively or as a service; the debian package sets it to log to /var/log/atop.log every ten minutes (edit /etc/init.d/atop for something more precise). You can then replay the logs with atop -r /var/log/atop.log -b hh:mm -mM; mM selects a... | Unpredictable memory explosions |
1,500,035,950,000 |
I do a lot of work on in the cloud running statistical models that take up a lot of memory, usually with Ubuntu 18.04. One big headache for me is when I set up a model to run for several hours or overnight, and I check on it later to find that the processes was killed. After doing some research, it seems like this i... |
You can ask the kernel to panic on oom:
sysctl vm.panic_on_oom=1
or for future reboots
echo "vm.panic_on_oom=1" >> /etc/sysctl.conf
You can adjust a process's likeliness to be killed, but presumably you have already removed most processes, so this may not be of use.
See man 5 proc for /proc/[pid]/oom_score_adj.
Of c... | Trigger a script when OOM Killer kills a process |
1,500,035,950,000 |
I am trying to monitor the CPU, RAM and computing time of a process, and all the children processes that it generates, using the Linux top command.
I found that I could store the output of the top command using this syntax:
$ top -b > top.txt
I am then parsing the results with a python script. But I am having trouble... |
After adding the PPID (or any other field) in the interactive top display, you only need to save the configuration using W (uppercase w). Then exit (q) and use top -b, it will include and show the fields as from the changes you made to top interactively.
| Display PPID and output to file using top |
1,500,035,950,000 |
I have a port 0x80 BIOS post debug card installed in a PCI slot. I want to use it purposefully after booting by having the CPU temperature displayed on the card. The address takes one byte and is displayed in HEX. How do I convert the two digit decimal Celsius temperature values into a single byte for writing to th... |
You want to convert the temperature, read as a decimal value, into a character corresponding to the hexadecimal value which when displayed, reads the same as the temperature...
The request sounds more complex than it really is; printf can be used to print a character corresponding to a given character code:
$ printf "... | Writing CPU Temperature to Port 0x80 Bios Debug Card with Bash Script |
1,500,035,950,000 |
We have several hundred Linux VMs on EC2 and Google compute engine. We want to monitor basic things like disk free space and memory consumption, in the easiest and lightest way possible. Expectedly, VMs come and go pretty often, as load changes, etc.
Currently we use simple scripts that pull such information via SNMP... |
If you are looking more into the open-source-direction, Open NMS might suit your needs. I did not use it myself, but I heard good things about it (especially from people, who dislike Nagios). From what I read about it, it is also SNMP-based.
| Monitor hundreds of hosts for basic parameters [closed] |
1,500,035,950,000 |
In Unix based systems, is there a log file that stores user's executed command(s)?
|
Given that you want to track all user commands, you should look at the acct package on your system (on some systems this is also called "process accounting" or psacct). Then after it's been turned on, you can run the lastcomm command to show what programs have been run, by whom, when and for how long. From Google, s... | User's executed commands log file |
1,500,035,950,000 |
I use a script that writes all mountpoints of my devices to a textfile using df. How can I execute my script every time any device (especially USB) is mounted?
script to execute:
#!/bin/bash
# save all mountpoints to textfile
df -h /dev/sd*| grep /dev/sd| awk '{print $6}' > /home/<user>/FirstTextfile
# do something
w... |
write a udev rule which first mounts the USB-drive and second runs my-script
# cat /etc/udev/rules.d/11-media-by-label-with-pmount.rules
KERNEL!="sd[a-z]*", GOTO="media_by_label_auto_mount_end"
ACTION=="add", PROGRAM!="/sbin/blkid %N", GOTO="media_by_label_auto_mount_end"
# Get label
PROGRAM=="/sbin/blkid -o value -... | how to execute a script every time any USB get mounted |
1,500,035,950,000 |
I'm pretty sure the Linux kernel has a feature which allows to track all the reads and writes (IO) of an application and all its children however I haven't seen any utilities which can calculate it and show it.
For instance for CPU time you could simply use time and get neat CPU use information:
$ time cat --version >... |
I came across this post and found it very interesting. I thought this problem was not that difficult since the question you are asking is quite natural after all.
I could only find an imperfect and incomplete solution. I decided to post it anyway, as the question was not answered yet.
This requires a system with syste... | Utility to show disk IO read/write summary for a task/command/program |
1,500,035,950,000 |
While an application is running, I can monitor disk bandwidth usage using linux tools including dstat.
Now I'd like to know how many sequential or random disk I/Os are occurring in the system.
Does any one know any ways to achieve this?
|
Ypu can write your own FUSE filesystem (what you can do using almost any scripting/programming language, even bash) , that would just proxy filesystem calls to pointed filesystem (and eventually translate paths) plus monitor what you minght want to monitor.
Otherwise you might investigate output of strace for programs... | Is there a way to monitor disk i/o patterns? (i.e. random or sequential i/o?) |
1,500,035,950,000 |
The problem:
Given a process, limit the resources it and its child-processes can use. I.e. set CPU time and virtual memory quotas. When the process group exceeds one of the limits, terminate it, otherwise print the amount of CPU time and virtual memory it has used.
The concrete use case:
Basically I must execute a c... |
The setrlimit(2) syscall is relevant to limit resources (CPU time -integral number of seconds, so at least 1 sec- with RLIMIT_CPU, file size with RLIMIT_FSIZE, address space with RLIMIT_AS, etc...). You could also set up disk quotas. The wait4(2) syscall tells you -and gives feedback- about some resource usage. And pr... | Resource (CPU time and memory) limitation and termination of a process upon violation in Linux |
1,420,556,101,000 |
I am using command nc -lu <port no.> to find on given port any data is receiving or not. I am getting data if there is transmission going on (but don't know from where!). Is there any way that should provide me the transmitters IP address??
wireshark and nmap are there, but I want a shorter way, if possible.
UPDATED: ... |
I like the answers posted so far. Here are some other options:
Add the -v option to nc. This will show (only!) the first source address that a UDP packet is received from.
Also, netstat -nu seems to have some connection-ish state information for UDP conversations.
| find which system is transmitting through a particular port |
1,420,556,101,000 |
I just need to get how much bandwidth is used in 3 or 4 days. Do you have any application in the terminal to do it?
I'd prefer if it didn't use SNMP.
I found iptraf, wireshark, cacti, but they were not what I am looking for.
Of course I need to save my results; for a single computer, not a network.
It's very importan... |
You know you already have that with ifconfig right?
Ifconfig keeps counters about your incomming and outgoing bandwidth on each interface by default. Usually you can't reset counters except rebooting (with a few exceptions)
From console you can easily leave a cron running each three days and saving results to a file ... | Bandwidth monitoring in Linux |
1,420,556,101,000 |
I have two folders called: A and B, in different paths on the same computer. When I add any new file(s) into folder A, I want to copy it to folder B automatically.
My folders:
/auto/std1/nat1/A
/auto/std2/nat2/B
What I currently do to copy the files:
cp -r A B
But I want this process to run automatically in the back... |
Per your bonus question, add the following line below the rsync command in the shell script I provided below. I wrote this in the comment but I'll officially add it to my answer here:
find /auto/std2/nat2/B -name '*.zip' -exec sh -c 'unzip -d `dirname {}` {}' ';'
This will handle unzipping all the zip files that ... | Run command automatically when files are copied into a directory |
1,420,556,101,000 |
I would like to find files accessed by specific user (even just read) within a folder tree. I thought the find command had this option, but it actually just searches for owner user. Is there any other command, or command combinations? The stat command offers access information, but doesn't display the user who made ac... |
This information is not stored by traditional filesystems. You have three main options:
See who is accessing it in real time using lsof/fuser or similar;
Set up auditing (take a look at auditd);
Use something like LoggedFS.
| Unix command to find files read by specific user |
1,420,556,101,000 |
I'm running Fedora 31 Security Lab updated to the latest on Acer, with wireless driver ath10k_pci.
The case is is that when i run airmon-ng there are no captured packets.
Does the hardware is problematic or the driver?
I've stopped the Network Manager , then ran airmon-ng check kill and then airmon-ng it shows that... |
After some days in research and testing on second distro (Ubuntu), the conclusion is that this adapter does not support monitor (or at least not with the default drivers) so I bought TL-WN823N USB adapter. It is cheap and monitor mode works like charm. So if anyone encounters this problem - this is my solution
| No monitor mode on Atheros QCA9377? |
1,420,556,101,000 |
Playing around with some low level functions to monitor my system stats.
I would like to get the current network utilization the same way like I can get cpu temp
cat /sys/class/thermal/thermal_zone0/temp
or fan speed
cat /sys/class/hwmon/hwmon6/fan1_input
Looking at
/sys/class/net/my_network_adapter/
I didn't find ... |
To get the rate of B/s, no need of anything but your shell: Simply read rx_bytes file at each second and compare the current value with the value one second before.
rx1=$(cat /sys/class/net/wlp3s0/statistics/rx_bytes)
while sleep 1; do
rx2=$(cat /sys/class/net/wlp3s0/statistics/rx_bytes)
printf 'Download rate:... | Get current network utilization via /sys/class/net |
1,420,556,101,000 |
I have a command running for a long time, which I don't want to disturb. However, I would like to keep check on the process (most of the time remotely). I am constantly monitoring the process via commands like top, iotop, stat etc. The process is a terminal based process which wasn't started via screen or tmux or simi... |
I would use strace for that:
strace -qfp PID -e trace=write -e write=1,2
That will trace all write(2) system calls of PID and its child processes, and hexdump the data written to file descriptors 1 and 2.
Of course, that won't let you see what the process has already written to the tty, but will start monitoring all ... | Get latest output of a running command |
1,420,556,101,000 |
I just found some odd behaviour on one of our servers that I can't explain myself.
It is about both middle lines. I would assume that the timespans for the boot user must not overlap, however, they do:
$ last reboot -F
reboot system boot 4.4.44-39.55.amz Wed Feb 15 09:16:30 2017 - Wed Feb 15 09:36:53 2017 (00:20) ... |
These are not entries of a boot user logging in or out, it's the system writing an entry upon reboot.
The entries are written when a reboot occurs, however, if the system was brought down in some other way (by unplugging the power or whatever), an entry would not have been written. I presume that the next orderly shut... | last reboot -F shows overlapping timespans |
1,420,556,101,000 |
I'm writing an AI personal assistant. One part of the software is a monitor daemon. A small process that monitor's user's active windows. I'm using python( with libwnck and psutils for obtaining info on active windows). One thing I'd like my monitor to do is to keep track of music that the listener often listen's to. ... |
You can monitor the opening/closing of files using the inotify subsystem.
pyinotify is one interface to this subsystem.
Note that if you have a lot of events going to inotify, some can be dropped, but it works for most cases (especially your case in which user interaction will drive the opening/closing of files).
pyin... | How to monitor the opening and closing of files? |
1,420,556,101,000 |
For some unknown reason there is no space left on my /, even 5 minutes after removing 300 MBs of junk packages, there is no space left again. So I've come to conclusion that there is some process that floods my disk space. (--> Recently I installed docker).
How can I find which process produces most data on /?
|
Your best bet is probably iotop:
iotop watches I/O usage information output by the Linux kernel
(requires 2.6.20 or later) and displays a table of current I/O usage by
processes or threads on the system. At least the CON‐
FIG_TASK_DELAY_ACCT, CONFIG_TASK_IO_ACCOUNTING, CONFIG_T... | How to find which process is currently writing to the disk? |
1,420,556,101,000 |
I would like to use a bash script (python would be second best) to monitor regularly (hourly) if my mailserver is online and operating.
I know that there are dedicated solutions for this task (Nagios, ...) but I really need something simple that I can use as a cronjob. Only to see the mailserver is alive.
I know how t... |
You can use nc to test a SMTP mail server like so:
$ nc -w 5 mail.mydom.com 25 << EOF
HELO mail.mydom.com
QUIT
EOF
NOTE: The options -w 5 tell nc to wait at most 5 seconds. The server to monitor is mail.mydom.com and 25 is the port we're connecting to.
You can also use this form of the above if you find your server i... | simple script for monitoring a mailserver |
1,420,556,101,000 |
I am working on a unix server and I guess during some time in past the file system had been full. However, I need some solid data to prove it. Will there be any OS logs or something of that sort to confirm my assumption?
It's an AIX system.
|
On AIX, you will get entries in the standard error log if a filesystem operation fails due to a filesystem being full. You can view that error log with the errpt command.
You will see something like this,
IDENTIFIER TIMESTAMP T C RESOURCE_NAME DESCRIPTION
xxxxxxxx xxxxxxxxx I O SYSJ2 UNABLE TO ALLOCATE SPAC... | What logs would be written if file system is full in UNIX? |
1,420,556,101,000 |
On a Linux (debian) box, I have a NFS server wich seems to be overloaded by requests. In order to identify the problem, I'm trying to monitor with auditd/auditctl accessed files in the partition exported by the NFS server.
The problem is that our disk or nfs problem prevents auditd to write logs on /var/log/auditd/au... |
I'm assuming you're on Linux by how you phrased your question. Should that be the case, then yes there is, look into audisp-remote and audispd. These are standard components in the current audit tools on Linux.
| Can I send auditd logs to another computer? |
1,420,556,101,000 |
Is there an existing tool for solaris/unix that keeps a history trail of the list of running processes. I'd like to be able to review backwards in time what processes were active/running.
I can create a cron job that just regularly logs the output of ps into files, but this is crude and over a large server farm seems ... |
Use auditing.
Solaris Auditing (Overview)
Auditing generates audit records when specified events occur. Most
commonly, events that generate audit records include the following:
System startup and system shutdown
Login and logout
Process creation or process destruction, or thread creation or thread destruction
Open... | Is there a process logging tool for solaris? |
1,420,556,101,000 |
There are times as a system administrator, you might not be sure of the log file paths of a new application. Depending on the system, there may be multiple ways to find the same. Please share the different ways we can get a list of open log files on a system.
|
User X files
If you need to see just a single user's open files:
$ lsof -u<user>
Or only files with a text file descriptor (typically real files):
$ lsof -a -u<user> -d txt
Example
All files in use by user saml.
$ lsof -usaml
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
vim 13... | List all open '.log' files in *nix |
1,420,556,101,000 |
sensors-detect has this warning :
Lastly, we can probe the I2C/SMBus adapters for connected hardware
monitoring devices. This is the most risky part, and while it works
reasonably well on most systems, it has been reported to cause trouble
on some systems.
What kind of trouble does it refer to ?
|
From sensors-detect manpage:
sensors-detect needs to access the hardware for most of the chip detections. By definition, it doesn't know which chips are there before it manages to identify them. This means that it can access
chips in a way these chips do not like, causing problems ranging from SMBus lockup to perma... | sensors-detect warning on I2C/SMBus |
1,420,556,101,000 |
My router died today, so I used nm-applet on xfce to make a wireless network using my computer and modem. It only appeared to support WEP security. I felt I should keep track of who is connected, but I couldn't find out how, and Google only came up with results for iPhones and Android. How could I tell who's connected... |
A GUI program I personally like is EtherApe, which has a nice graph showing current network activity with protocol and traffic amount.
| How do I tell who is connected to my network and how much bandwidth they're using? |
1,420,556,101,000 |
I'm configuring Zabbix to monitor our servers. Zabbix is new to me. It is up and running, and monitoring works for some services.
One of our Centos servers has http running, so it seems logical to monitor that. I've added the "Template App HTTP Service" to the host. I used all default settings, didn't change anything... |
This is probably a firewall issue. We maintain here the Linux systems, and most of the time these kind of issues are due to the network team forgetting default firewall rules to new networks or new servers.
To debug the situation the best strategy is to try to telnet in the command line from the Zabbix/monitoring serv... | Zabbix claims that HTTP service is down |
1,420,556,101,000 |
I'd like to know if I can track commands entered by user in a bash shell, in real time.
What I'm trying to do is something similar to thefuck, but I need to prompt the user as and when he enters new commands into the shell.
Is there any way I could write a hook to bash that kind of lets me wrap my code around it ?
Al... |
Put export PROMPT_COMMAND='history -a' to /etc/profile or other profile file. This causes the history -a command to execute before every command prompt display. history -a flushes history to .bash_history immediately.
| Is it possible to track bash commands in real time? |
1,420,556,101,000 |
I know conky can monitor my personal computer, but can it monitor the other Linux servers I have on the network? I'd like to see data on CPU and memory usage and some critical processes each server uses. For instance, one server is our MySQL server, so I'd like to display the CPU and memory usage for this server, how ... |
I wrote a program for this very purpose: Conkw. It stands for web based conky.
This is a program that, like conky, can monitor many vitals on your system but also all sorts of stuff (stocks, weather, etc) and exposes a REST API with all the data. It can also monitor a Windows or a MacOS machine.
There is also a HTML U... | Can conky monitor other Linux computers on the network? |
1,420,556,101,000 |
For example, the IDE I'm using at the moment (Aptana Studio) notifies me as soon as a file's contents it has open have been changed by some external program.
I can imagine having a periodic loop run stat() on a file and check the time of last data modification. Is this how it's normally done or is there a blocking int... |
The inotify system on Linux, or the kqueue system on BSD/OSX, gives you an event-driven ("interrupt-like") mechanism to do this.
| Efficient mechanism to determine if open file has been externally modified? |
1,420,556,101,000 |
This is rather a basic linux administration question. We have a CentOS linux machine running a production application. There are 10 application specific processes running on that machine. Once in every 3/4 days, the linux machine freezes and the only way to get it back is to hard reboot it from Amazon AWS console.
We ... |
You could simply run top in batch mode and save the output to a file:
$ top -b -d 2 > /your/log/file &
-d 2 is the sampling period. Be warned that this will generate quite a bit of data.
You might want to use the -u option to only list processes for a given user, or even the -p option to explicitly list your applicat... | find out the culprit process |
1,420,556,101,000 |
We are running virtual machines in kvm and i am trying to collect metrics and send it to influxdb + grafana for graphing.
I can see CPU stats using virsh but its in time in second spend, how do i convert this value in proper usage in % or human readable metrics?
[root@kvm01 ~]# virsh cpu-stats --total instance-00000... |
Calculating a CPU percentage is dependent on the time window you are looking at. So if you call virsh cpu-stats once, then call it again 10 seconds later, you would do need to do something like:
(cpu_time2 - cpu_time1) / (10 * vcpus)
That will tell you what percentage of the total time window the VM CPUs were running ... | libvirt kvm cpu/memory stats collection |
1,420,556,101,000 |
To take a look at the temperature history in on my SSD, I used the smartctl -l scttemphist command. The output says that it is skipping lots of entries. Why is it doing this? I don't think that it is because it does not have them saved.
=== START OF READ SMART DATA SECTION ===
SCT Temperature History Version: 2... |
You can download the sources or see here that smartctl is merely optimising the output by removing groups of identical temperatures. If you want to have all the values, recompile after removing this while{} loop at line 2216 (keep the initialisation line).
// Find range of identical temperatures
unsigned n1 = n, n2 =... | Why are there "skipped" temperature entries in the SCT Temperature History output? |
1,420,556,101,000 |
I've been using Linux for 99% of the time on my Dell XPS15 9550. It has an Intel i5-6300HQ (Skylake) CPU.
On Windows, I can monitor the voltage of the CPU using a plethora of different software: Intel XTU, HWinfo, CPU-Z, AIDA64 and many more. On Linux, my only shot seems to be with LM-Sensors... which unfortunately do... |
I found out i7z actually does report the Vcore on my system. My terminal was simply not wide enough to show the last column, which was indeed Vcore.
So a partial answer is: use i7z. However, it would be even better to have this data collected by lm-sensors too. Currently it does not, so most monitoring programs that u... | How to monitor CPU voltage for a Dell XPS15 9550 (Skylake i5-6300HQ) under Linux |
1,420,556,101,000 |
On a server hosting a wide range of websites, I often see IO becoming a bottleneck without being able to identify the processes responsible of IO operations with tools such as iotop, iostat or sar.
I suspect that those processes are performing a lot of IO on metadata (reading and/or writing attributes, creating or rem... |
I came up with a systemtap script which is close to what I wanted to do, but it does not track writes.
The code is on a gist: https://gist.github.com/Martiusweb/10633360
| Monitor when read/write on metadata or mmaped files hit the disk |
1,420,556,101,000 |
Just starting to look into mcelog for the first time (I've enabled it and seen syslog output before, but this is the first time I'm trying to do something non-default). I'm looking for information on how to write triggers for it. Specifically, I'm looking for what kinds of events mcelog can react to, how it decides wh... |
Looking at the sample mcelog.conf config file it looks to contain most if not all of the types of triggers it can deal with.
DIMMs
[dimm]
#
# execute these triggers when the rate of corrected or uncorrected
# errors per DIMM exceeds the threshold
# Note when the hardware does not report DIMMs this might also
# be per ... | Writing triggers for mcelog |
1,516,637,501,000 |
I am using Linux as a desktop, and keep getting seemingly random I/O Spikes. The machine becomes unusably slow. At first I thought it was just that I don't have enough memory. But looking at the output of free and top there was nothing out of the ordinary. Same thing for CPU load.
If I don't kill the offending process... |
I have found the culprit.
It was indeed due to a faulty swap setup. My fstab listed /dev/mapper/cryptswap as swap space. This was nonexistent. My guess is that as soon as the system needed to swap, it saw swapspace defined, but that device did not exist anywhere.
For testing I simply created empty files as swapspace. ... | How to track down the source of I/O spikes? |
1,516,637,501,000 |
I've used yum install nagios on an Amazon Linux instance, and it created a nagios user with shell /sbin/nologin and homedir /var/spool/nagios. This is the behaviour on EC2.
I want to use check_by_ssh running locally as user nagios to execute a command on the remote host as some user, without typing in a password. So u... |
Run su -c 'ssh-keygen -N ""' nagios to generate the key pair, or alternatively generate the key pair as another user then copy it in place into ~nagios/.ssh. Then run su -c 'ssh-copy-id someuser@remote-host' nagios to install the public key on the remote machine.
You can change the nagios user's home directory if you ... | How to enable nagios user created by yum to use check_by_ssh |
1,516,637,501,000 |
I am trying to use inotifywait to monitor a folder:
inotifywait -m -r /home/oshiro/Desktop/work_folder
The command works and if I create files in that folder, all seems to work correctly.
While the folder is being monitored, if I delete it, I get the following output:
/home/oshiro/Desktop/work_folder/ MOVE_SELF
/hom... |
First off, if you delete a folder that inotifywait is watching, then, yes, it will stop watching it. The obvious way around that is simply to monitor the directory one level up (you could even create a directory to monitor especially and put your work_folder in there.
However this won't work if you have a folder under... | inotifywait not working when folder is deleted and re-created |
1,516,637,501,000 |
I have a process running on a raspberry pi. After ssh ing into in to the process is started like this:
nohup .../blah/blah &
IIUC this allows me to log out of the pi and the process keeps running. However it dies sometimes, and I have to log in and manually restart it. Is there a way to monitor it and have it rest... |
Run it in an infinite loop:
#!/bin/sh
while true; do
.../blah/blah
done
This would be a script that you start with nohup in the background. When blah dies, it is immediately restarted, until the script is killed.
A variation that ends the loop if a file called stopme appears in the working directory of the scrip... | Automatically restarting a process when it dies? |
1,516,637,501,000 |
I am running a "kiosk" computer - one for general use for anybody in the room - and I want to know if anyone is actually using it. Is there a log that tells me when firefox, chromium or other programs are run?
I am not asking for logs of what they are doing in the programs, just whether or not they are being used.
An... |
You probably should be interested by process accounting. See acct(2), acct(5), sa(8)
| Log when program is run |
1,516,637,501,000 |
I would like to monitor total CPU utilization percentage as a counter. The reason I would like it as a counter is that data won't be lost between samples (and I can have the graphing side calculate the rate).
My initial approach was to use /proc/uptime with the formula (uptime-(idle_time/num_core))*100. This generall... |
(uptime-(idle_time/num_core))
May give an idea of how long the system has been busy, in seconds. Multipling that by 100 makes it centiseconds -- is that your intention?
IMO it would make more sense to consider how many processor seconds in total were available, and subtract the idle time from that:
uptime * num_core... | How to get CPU Percentage as a Counter? |
1,516,637,501,000 |
I'm about to set up Tenshi in order to get important log excerpts.
Everything works fine except if I add some apache2 logs,
# /etc/tenshi/tenshi.conf
...
set logfile /var/log/apache2/error.log
I also created a Tenshi include for apache2, but it doesn't work.
# /etc/tenshi/includes-active/apache2
group ^apache2:
tr... |
I finally managed this:
In tenshi.conf use:
set logprefix ^(\[[^\]]+\]\s)
This prevents the parsed logfiles from reaching the noprefix queue.
My apache2 error logfile looks like this:
[Thu Jan 23 23:36:40 2014] [error] [client 255.255.255.255] File does not exist: /var/www/whatever.html
So in includes-active/apach... | tenshi and logfiles |
1,516,637,501,000 |
So i have a script that emails me if a login is from anything besides an ip address that starts with "10.1.":
#!/usr/bin/python
import smtplib, os
server = "10.10.10.10"
From = "[email protected]"
to = ["[email protected]"] # must be a list
subject = "SSH Login from outside network"
ip = os.environ['SSH_CONNECTION... |
You could have the script triggered when a login session is opened.
pam-script is a PAM module that allows you to execute scripts within the PAM stack during authorization, password changes, and on session opening or closing.
In Debian-based Linux distributions it is provided by the libpam-script package. In Fedora th... | SSH alerts for outside IP addresses |
1,516,637,501,000 |
In bash, .bashrc (and various other scripts) can load into memory at shell startup. These can be 10 lines long, but can be hundreds (if not thousands) of lines long. Each export will consume a tiny amount of memory, and each function and each alias also a little resources to be held in memory. Another consideration is... |
The impact of your startup scripts and the resulting setup will mostly affect interactive shells; to determine the resulting resource consumption, you don’t need to go to huge lengths. Open a terminal window, so that your default shell starts with its default setup, then start a shell without loading the startup scr... | In bash, is there a way to see how much memory .bashrc and any startup scripts are consuming? |
1,516,637,501,000 |
I need to display in GUI for operator used memory vs available on Linux Server
So what would be logically correct value to display as usage?
[root@host ~]# free
total used free shared buff/cache available
Mem: 131753676 110324960 1433296 4182648 19995420 1624064... |
It depends what your usage is supposed to reflect. In free’s output:
“used” is calculated as “total – free – buffers – cache”, so it reflects the amount of memory currently storing useful data, excluding cache;
“available” is supposed to be the amount of physical memory which can be immediately made available for oth... | What is "effective used" memory on Linux? "used" or ("total"-"available")? |
1,516,637,501,000 |
I have setup a basic udev rule to detect when I connect or disconnect a mDP cable.
The file is /etc/udev/rules.d/95-monitor-hotplug.rules
KERNEL=="card0", SUBSYSTEM=="drm", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/var/run/gdm/auth-for-vazquez-OlbTje/database", RUN+="/usr/bin/arandr"
It should just launch arandr when the... |
An udev rule applies to the add action by default. The udev rule is on a graphics card, not on a monitor; so it runs when a graphics card is added to the system, which in practice means at boot time.
Plugging in a monitor results in a change action, not an add action. You can observe this by running udevadm monitor an... | udev monitor hotplug rule not running |
1,516,637,501,000 |
I want to run sudo airodump-ng -w myfile every ten minutes or so, for m minutes. It does not matter if the running time shifts (that it, if it runs m minutes later each time).
Notice that this is a monitoring program, which won't just output and exit. I suppose the solution for this one question is also valid for si... |
Don't use pkill. Instead, run your app under the timeout command from the coreutils package:
*/10 * * * * timeout 5m airodump-ng mon0 -w myfile
(Where here 5m means to run for 5 minutes.) Use --signal if you need something other than TERM.
| Run and stop a monitoring command as sudo for s seconds every m minutes |
1,516,637,501,000 |
How can I know which application is using the most network bandwidth? I saw some graph from KDE's network monitor, but don't know which process did that.
|
As far as I know, iftop can not show which processes are using the bandwidth. If you need this information, you should check out nethogs.
| How to identify the program that uses most bandwidth? |
1,516,637,501,000 |
I just installed atop, waited half an hour, and looked at the logs with atop -r /var/log/atop/atop_20180216.
Why does my systemd --user instance show hundreds of megs of disk usage, including tens of megs of writes, during one ten minute interval? What can systemd possibly be doing?
PID TID RDDSK W... |
[RDDSK / WRDSK]
When the kernel maintains standard io statistics (>= 2.6.20):
The [read / write] data transfer issued physically on disk (so writing to the disk cache is not accounted for). This counter is maintained for the application process that writes its data to the cache (assuming that this data is physically ... | systemd shows as reading 300M in atop? |
1,516,637,501,000 |
When upgrading from Jessie to Stretch, at the end of dist-upgrade, it ends with an error:
Errors were encountered while processing:
nagios-nrpe-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
Have tried running apt upgrade, install, and reinstall without correcting this.
What to do?
|
To finish installing nagios-nrpe-server, I ended up verifying the post-install scripts.
At nagios-nrpe-server.postinst:
#!/bin/sh
set -e
# Automatically added by dh_installinit
if [ -x "/etc/init.d/nagios-nrpe-server" ]; then
update-rc.d nagios-nrpe-server defaults >/dev/null
invoke-rc.d nagios-nrpe-server sta... | Strange nagios-nrpe-server error upgrading from Jessie to Stretch |
1,516,637,501,000 |
Is there a way to monitor interface up/downs, especially to check if a route is setup or removed, with udev?
|
I am really not sure (and highly doubt it) if udev provides an interface for it but you can easily monitor it without udev. You just have to use a netlink socket with NETLINK_ROUTE to get notifications about changed addresses, changed routing tables etc.
| Monitoring interface changes with udev, especially if a route is set |
1,516,637,501,000 |
The dedicated server I'm looking after started to crash occasionally, I suspect because of overload, so I need some performance/resource based monitoring software, preferably with web interface, something like OpenNMS which I have tried, but did not like. The OS is Linux CentOS 5.3
P.S. There over 50 websites running ... |
There are a lot of answers. I personally use Zenoss, but there's a big list here: http://en.wikipedia.org/wiki/Comparison_of_network_monitoring_systems
| Linux server monitoring software |
1,516,637,501,000 |
Can I make top show info about the web and db servers? Can it be done by piping the pids to the top? They can be many process from every one?!? Or is there any better method for this?
|
In the case of web and database users, they usually run as their own user. You can use the -u flag to show only processes running as a certain user like this: top -u mysql. You may also use the -p flag with a comma separated list of PIDs you want to follow like this: top -p 123,234,345.
You might also find htop more u... | Make top shows only server process |
1,516,637,501,000 |
My business purpose is to monitor the remote file system on Linux, and if there are any new files, SFTP them to another machine and delete them.
However, the limitation is that I cannot install any libraries on the remote machine. So, I am considering implementing interval SSH command polling to the remote machine.
My... |
The simple and lazy way:
crontab with your regular user on local system (every 15 min):
*/15 * * * * /bin/bash /path/to/script.sh
The code:
#!/bin/bash
source ~/.bashrc
ssh-add /home/me/.ssh/id_rsa
ssh user@remote-server printf '%s\n' '/path/to/new_files/*' > ~/.$$_remote-files
if ! cmp ~/.$$_remote-files ~/.remote... | How do you monitor remote file system on Linux? |
1,516,637,501,000 |
I have an ubuntu instance on AWS and I want an email when 80% of disk space is consumed. I have checked the cloud watch but there is no such option to monitor disk space. There is only one option which is custom metric https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/mon-scripts.html but I am not sure that it will ... |
Update:
1. Create an instance and attach the IAM Role :
AmazonEC2RoleforSSM
CloudWatchAgentAdminPolicy
CloudWatchAgentServerPolicy
AmazonSSMManagedInstanceCore
2. Install CloudWatch agent : : In the RunCommand , choose AWS-ConfigureAWSPackage to the install it on the desired Target.
3. Running the CloudWatch ag... | How to set email alert for disk space usage for ubuntu instance on AWS? |
1,512,548,446,000 |
I have atop logs stored on a dayly basis with 10 min interval and I can read them with atop -r <path_to_log>, but how can I find a peak memory usage in this log?
|
The command to analyze the recorded data is atopsar.
For example:
# atopsar -r /var/log/atop/atop_20170511 -m -R 1 | head
trucka 3.4.113-sun7i+ #1 SMP PREEMPT Fri Oct 28 16:54:21 CEST 2016 armv7l 2017/05/11
-------------------------- analysis date: 2017/05/11 --------------------------
00:00:01 memtotal memfree ... | atop peak memory usage from log |
1,512,548,446,000 |
I have a monitor with resolution 1440x900, 19 inch, whose PPI is 89.37.
I can set the screen DPI with command:
# xrandr --dpi 100
But the problem is my monitor's PPI is only 89.37, how can xrandr command sets the monitor's DPI bigger than PPI? (From my understanding, PPI is monitor's property, and it cannot be change... |
The “DPI” setting that you can set with xrandr is purely an indication to applications, it doesn't configure the hardware. Normally the monitor reports to the computer what its resolution and pixel density is. You can replace the reported value with a fake one if you want, or set a value if the monitor doesn't report ... | What if I set DPI bigger than monitor's PPI in gnome using xrandr? |
1,512,548,446,000 |
I have some daemon scripts that run in an infinite loop that do some action if a detected node has failed. For example; in AWS to move an Elastic IP.
How can I integrate this script that runs in an infinite loop to push an alert to sensu? The traditional Sensu documentation about checks does not apply (this script run... |
Sensu has documentation on how to do this here: https://sensuapp.org/docs/latest/clients#client-socket-input
Basically, each sensu client (client.json) has an internal socket that you can send external data to; by default this socket only listens on 127.0.0.1:3030 so the config for the client has to be adjusted:
{
"... | How to integrate daemon scripts with sensu? |
1,512,548,446,000 |
I am using a Ubuntu machine as a NAT router. How can I find out the following:
the ports on which the LAN machines are listening or communicating (both tcp and udp);
which local machines have established connections with which WAN ip's on those ports;
and the size of data that has been transfered on those ports.
|
I think you want to try netstat-nat I seem to remember using it when I had a Slackware box set up as a NAT-server.
| Port monitoring on GNU/Linux based NAT router |
1,512,548,446,000 |
What I need
I want to monitor system resources (namely memory and cpu usage) by application - not just by process. Just as the Windows Task Manager is grouping resources by the "calling mother process", I like to see it like that as well. Nowadays, applications like firefox and vscode spawn many child processes and I ... |
This script below requires a lot of additional improvements, but I think it can serve as a basis.
I started to write comments, but for now, not able to finish it. I will use edits to my answer to add new comments and fix bugs when I get more free time.
In my environment it works fine. I called this script mytop and pu... | Get memory/cpu usage by application |
1,512,548,446,000 |
I'm managing a few compute servers w/ roughly 20 users each. I'm using htop to view current resource usage, however it would be very helpful to have a log of a specific user's cumulative memory and cpu usage. Is there any way to view/log this via htop or bash?
|
You could use top -bn1 -U {user} to create a file which you can then do additional processing on to gain a cumulative usage.
The argument -bn1 makes top run in a non-interactive mode, simply outputting once when finished. You can then pipe that output anywhere for additional processing.
for example,
top -bn1 -U {user}... | Cumulative resource usage |
1,512,548,446,000 |
I have a Raspberry Pi (running Raspbian) that is booting from a microSD card. Since it's acting as a home server, naturally I want to monitor the microSD card for errors. Unfortunately though, microSD cards don't support SMART like other disks I have, so I am unsure how to monitor the disk for errors.
How can I monito... |
You can replace smartctl -t long selftests with badblocks (no parameters). It performs a simple read-only test. You can run it while filesystems are mounted. (Do NOT use the so-called non-destructive write test).
# badblocks -v /dev/loop0
Checking blocks 0 to 1048575
Checking for bad blocks (read-only test): done
Pass... | How to test a disk that does not support SMART for errors? |
1,512,548,446,000 |
--- The context ---
I'm using Openbox to create a dedicated workspace/desktop for my browser -- the browser only opens on that workspace, and any other windows created on it get kicked onto a different workspace.
This works for most of my browsing, but with fullscreen-capable content such as streaming videos or Flash ... |
A program that monitors window creation doesn't come to mind, but you don't need that.
You can run wmctrl -l in a loop or on a timer (e.g. sleep 10; wmctrl -l) and then start the fullscreen application and record its window properties. If you want more information, you can do something like
sleep 10; xprop
After 10 s... | How do I find out the window name of fullscreen internet content (eg Flash)? |
1,512,548,446,000 |
We have a server (camera) sending RTSP video packets via UDP. At a customer site it travels over several hops, one of which may be an unreliable WiFi link that drops the odd packet or five. Usually this goes unnoticed but sometimes it kills the stream for some seconds and causes customer displeasure (I know, their cr*... |
Well it looks like it was the ARP table going stale (even though we're streaming UDP like crazy, that doesn't kick the ARP timeouts, and TCP traffic is much more sparse under normal operation) upping the timeouts stopped the issue from appearing for "breaks" of less than ~2mins (at which point the RTSP client session ... | What is stopping our UDP packets (how does it know the route is down)? |
1,512,548,446,000 |
What is the difference between real and actual memory usage in xymon ?
|
According to Henrik Stoerner at http://lists.xymon.com/oldarchive/2006/02/msg00115.html , real is the physical memory, actual is the amount of memory in use not including buffers and cache, all based on the output of the free command.
| Real vs Actual memory in Xymon/Hobbit |
1,512,548,446,000 |
Based on this question, I would like to log the performance of a specific process, with a frequency of say one second, to a csv (comma separated value) log file.
Something like:
timestamp(unix),cpu_activity(%),mem_usage(B),network_activity(B)
1355407327,24.6,7451518,345
1355407328,27.6,7451535,12
1355407329,31.6,74517... |
i tried to get rx_bytes and tx_bytes but no luck, other things is working.. So you can use below script for the same
#!/bin/bash
# /sys/class/net/eth0/statistics/rx_bytes
# /sys/class/net/eth0/statistics/tx_bytes
Process="$1"
[[ -z $2 ]] && InterVal=1 || InterVal=$2
show_help() {
cat <<_EOF
Usage :
$0 <Pr... | Monitor single process to logfile perodicly |
1,512,548,446,000 |
I am looking for a versatile tool that can write either to a MySQL db, or possibly simply even just write some image charts (that i can display on a PHP dashboard) to monitor my network health.
Is the best approach to run some type of daemon on my Debian box and somehow capture data from remote hosts via SSH? Also an... |
It wasn't clear how 'free' you wanted this tool to be. Intermapper does this:
http://www.intermapper.com/
But it isn't free(but does run on UNIX).
As far as open source goes, Network Weather map and Weathermap4rrd can do this. Here is an example Weathermap4rrd image:
http://weathermap4rrd.tropicalex.net/images/w4_ex... | Reporting Network and Vital Statistics and writing to db and image |
1,512,548,446,000 |
If I run:
ssh -fND localhost:6000 USERNAME@IPADDRESS -p PORTNUMBER
and I set my webbrowser to use 127.0.0.1:6000 SOCKS5 proxy, is there a way for the remote SSH server to monitor my web traffic?
I've seen this post that allows traffic to be monitored on a per-user basis, but what can they do if there is only 1 SSH us... |
"They" can correlate the ssh session with both your real IP and the traffic coming out of the ssh server. This method of tunneling traffic over ssh is great for encrypting the contents of the traffic between the ssh client and the ssh server, but it won't help you avoid monitoring on the ssh server.
| How to monitor traffic when SSH tunneling? |
1,424,409,229,000 |
I have come across vnstat recently, and am enjoying it's simplicity, low resource usage, and its ability to record network history long term.
However, I am looking for a similar tool (for long term archival history), which can record the amount of traffic through network ports.
Ultimately, I'd like to be able to view... |
Darkstat serves my purposes nicely. However, I have found that version 3.0.715 works better than 3.0.717.
| How to record network throughput per port for long period of time |
1,424,409,229,000 |
I have some questions about viewing who accessed a file.
I found there are ways to see if a file was accessed (not modified/changed) through audit subsystem and inotify.
However, from what I have read online, according to here:
http://www.cyberciti.biz/tips/linux-audit-files-to-see-who-made-changes-to-a-file.html
it s... |
Logs from the audit subsystem are based on paths. You can put a watch on a file name even if that file doesn't exist. You'll get log entries if the file is created and accessed.
All logs from auditd are saved in one file (generally /var/log/audit/auditd.log).
You can list the audit rules with auditctl -l.
| How to know who accessed a file or if a file has 'access' monitor in linux |
1,424,409,229,000 |
My web server is running CentOS and every time a certain page is accessed on my forum, httpd locks up and I can never seem to pinpoint the exact file.
Is there any way to view the pages that currently have requests open on a CentOS/UNIX-based server?
|
You can try using ApacheTop.
It shows out output like this:
| Is there a way to find out which webpages are being accessed by clients on a UNIX webserver? |
1,424,409,229,000 |
On top (of the default layout) I have the CPU graph box. The title line of this box says on the left : "cpu", "menu", "preset 0", and on the right : BAT○ 98%, and 2000ms.
Everything is self-explanatory, except BAT○. Clicking it does nothing. I noticed BAT and ○ don't have the same font.
An extensive search of the web ... |
It isn’t a display glitch, nor is it “BAT0”.
“BAT” stands for “battery”, and the circle (○) following that indicates that the battery charge status is unknown (this is independent of the battery charge level, which is indicated by the meter following “BAT”). Other possible values are an arrow-head pointing up (▲) if t... | What is the meaning of BAT○ in btop++? |
1,424,409,229,000 |
I do not need some kind of realtime visual status of my ethernet - I want to run my script when last five minutes I uploaded less than X. So I need to get only one number from some command. What can you recommend?
I use Ubuntu 14.04.
|
ifconfig <interface> gives you throughput of a specific interface.
For example,
root@trinity:~# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 28:92:4a:32:0c:43
inet addr:192.168.1.10 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::2a92:4aff:fe32:c43/64 Scope:Link
UP BROAD... | How much was uploaded in the last five minutes? |
1,424,409,229,000 |
How would you monitor a directory on a Linux machine to check if there was a user (or someone from the network) who attempted to access it?
|
inotify like so
inotifywait -m -e modify,create,delete -r /var/www >> /var/log/i-see-www 2>&1
assuming you meant "worked in" when you said "access", simply listing or reading files .. that'd be harder to do.
| Monitor accesses to directory on a Linux machine [duplicate] |
1,424,409,229,000 |
I just deployed my webserver using Apache in CentOS and I was wondering if anybody has any good ideas in how to check every specified amount of time if the server goes down and then I can use postfix to email me when this happens so I can go back to my server right away and fix the problem as well to see what caused t... |
You could have a script in your server that makes all kind of test among them if the server is alive, here's one:
#!/bin/bash
date;
echo "uptime:"
uptime
echo "Currently connected:"
w
echo "--------------------"
echo "Last logins:"
last -a |head -3
echo "--------------------"
ec... | Test script/program/app to check if my website is live |
1,424,409,229,000 |
We have a hacker occasionally attempting to hack a site, and so far unsuccessful, but I would like a way to determine if the site has been compromised (i.e., files edited). The type of attacks are LFI and attempting to inject iFrames in some source files. What can I install on my Debian server to alert me via an e-mai... |
You can install Tripwire and introduce a set of dicrectory to Tripwire, When a file has been changed, Tripwire notifies sysadmin.
| File monitoring to pre-empt hacker |
1,424,409,229,000 |
I need to monitor if, for example, file /tmp/somefile123 was created after some events. I tried to use inotifywait but here is a problem:
# inotifywait -q -e create /tmp/somefile?*
Couldn't watch /tmp/somefile?*: No such file or directory
because there is exactly no such file, I want to know if it will be there!
How ... |
By having inotifywait check on the parent directory:
/tmp$ inotifywait -e create -d -o /home/me/zz /tmp
/tmp$ touch z1
/tmp$ cat ~/zz
/tmp/ CREATE z1
You can also specify the time format for the event with the -timefmt option. Also, if you want to act immediately by executing some script file, for instance, you may u... | How to monitor whether a file was created? |
1,424,409,229,000 |
How can I monitor
Memory Usage: 33/512MB (6%)
Disk usage: 4.2/20GB (23%)
CPU Load: 0.01
on a Solaris 11 System? I want to make a script to monitor my desktop resources.
|
If you have one system then SAR is the a good alternative out of the box.
If you have multiple system you might want to evaluate other choices as well besides SAR.
Xymon and dimSTAT are two of them that I use and recommend.
dimSTAT is specially good for Solaris as it was developed with Solaris in mind by a Sun Enginee... | Memory usage and space disk on Solaris 11 |
1,424,409,229,000 |
I am running several process at startup using "crontab -e"
@reboot tranmission-daemon && python defualt.py && python MonitorService.py
But for some reason, those service can terminate by itself due to hdd insufficient, or web host killed it, how do I check if those service are killed and I re run it again?
I am using... |
I recommend supervisord (supervisord dot org) which happens to be written in Python.
Here is an article for installing it using the Python package manager: Herd Unix Processes with Supervisor.
If you would rather use RPM, then use this guide: Running supervisor 3 on CentOS 5
Hit back if you have any issues. It's a gr... | Detect process if not found then run it |
1,424,409,229,000 |
A few days ago I asked Is there a way to make tail -F beep?
Now I want to know if there is any way to use *nix utilities, to beep when a tail -F stops returning new lines for a while!
I know, I can write a simple application in any language to do this, but I was curious to know if there is a way to do this just by s... |
tail -F asdf.log | while true; do if read -t 1 LINE; then echo $LINE; else echo beep; fi; done
(Change the number after -t to the number of seconds of inactivity you want)
| Is there a way to beep when tail -F stops to fetch new results? |
1,424,409,229,000 |
I want to know if the Swap is used at all. free shows the usage of the memory:
# free
total used free shared buff/cache available
Mem: 1362084 169864 38288 724 1153932 1163816
Swap: 1048572 0 1048572
My understanding is that this is... |
If you want to see swap activity even if the space was released between checks, you can use a counter for exactly that.
$ cat /proc/vmstat | grep pswp
pswpin 0
pswpout 0
This has been answered here.
| How would one monitor Swap usage? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.