I have a centos 6.2 machine tried to yum install monit it says nothing to do. Then I have a link here http://pkgs.repoforge.org/monit/. Is this a reliable site or any other better suggestion? Thank you.
user111196's questions
I have a centos 6.2 box loaded the phpMyAdmin then I get missing mysqli then I yum install php-mysqli then I got to /etc/php.ini and put localhost under mysqli option for the host. So did I do the steps correctly? Now it gives my mcrpyt is missing? So what must I do please help ? I have tried yum install php-mcrypt but nothings to install is the message.
I have set monit to send email if my java listener failed on port 8000. I have tried to close the listner and run monit validate below is the errors I got.
monit validate
'cs8000' process is not running
Sendmail error: 550-Verification failed for <monit@localhost>
Aborting event
monit: Start or stop method not defined -- process cs8000
I have set the mailserver as below.
set mailserver mail.***.com port 26 username "test1@***.com" password "****" . I am just using the *** to hide the actual name.
What else must I set in order for the email to be send out?
I have a phpMyAdmin folder. So first I set .htaccess folder and type this in it.
AuthUserFile /var/www/html/phpMyAdmin-3.4/.htpasswd
AuthName "phpMyAdmin Login Page"
AuthType Basic
Require valid-user
The I created the username and password using this command
sudo htpasswd -c .htpasswd iamadmin
...and I could see both the .htaccess and .htpasswd files are in the folder. But when I go my link it never prompt for the additional username and password. My OS is centos 6.2
I am new to monitoring tools. Recently our server with phpMyAdmin was attacked with botnet. So I want to do some monitoring on my server for any their health and also security. What I am worried is that nagios is also another web application like phpMyAdmin is there any security loop hole in it where hackes can intrude via it? Secondly if there is no problem what should I do to setup monitoring for mysql and web servers? Or if there is any other options then?
Possible Duplicate:
My server's been hacked EMERGENCY
I have this server and it have been compromised. I notice the perl is running a lot but there is no such of perl programming I am running. Below is my top.
top - 21:20:54 up 8 days, 13:16, 1 user, load average: 2.02, 2.23, 2.52
Tasks: 97 total, 2 running, 93 sleeping, 0 stopped, 2 zombie
Cpu(s): 77.7%us, 22.3%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 1034892k total, 730176k used, 304716k free, 181616k buffers
Swap: 2097144k total, 0k used, 2097144k free, 381540k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
25687 apache 25 0 5328 2896 1176 R 49.9 0.3 818:58.72 perl
25675 apache 25 0 5328 2936 1192 S 49.6 0.3 818:58.48 perl
25564 root 15 0 10052 2928 2360 S 0.3 0.3 0:00.10 sshd
1 root 15 0 2160 640 556 S 0.0 0.1 0:02.86 init
2 root RT -5 0 0 0 S 0.0 0.0 0:00.00 migration/0
3 root 34 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/0
4 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
5 root 10 -5 0 0 0 S 0.0 0.0 0:00.38 events/0
6 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 khelper
7 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kthread
10 root 10 -5 0 0 0 S 0.0 0.0 0:01.16 kblockd/0
11 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 kacpid
86 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 cqueue/0
89 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 khubd
91 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kseriod
150 root 15 0 0 0 0 S 0.0 0.0 0:00.01 khungtaskd
151 root 25 0 0 0 0 S 0.0 0.0 0:00.00 pdflush
I am running a java application using this wrapper service yajsw. The problem it just stopped without any error in its logs file. So I was wondering will there be any system log file which will indicate the cause of it going down?
Partial of the log file.
Apr 6 00:12:20 localhost kernel: imklog 3.22.1, log source = /proc/kmsg started.
Apr 6 00:12:20 localhost rsyslogd: [origin software="rsyslogd" swVersion="3.22.1" x-pid="2234" x-info="http://www.rsyslog.com"] (re)start
Apr 6 00:12:20 localhost kernel: Initializing cgroup subsys cpuset
Apr 6 00:12:20 localhost kernel: Initializing cgroup subsys cpu
Apr 6 00:12:20 localhost kernel: Linux version 2.6.27.41-170.2.117.fc10.x86_64 ([email protected]) (gcc version 4.3.2 20081105 (Red Hat 4.3.2-7) (GCC) ) #1 SMP Thu Dec 10 10:36:29 EST 2009
Apr 6 00:12:20 localhost kernel: Command line: ro root=UUID=722ebf87-437f-4634-9c68-a82d157fa948 rhgb quiet
Apr 6 00:12:20 localhost kernel: KERNEL supported cpus:
Apr 6 00:12:20 localhost kernel: Intel GenuineIntel
Apr 6 00:12:20 localhost kernel: AMD AuthenticAMD
Apr 6 00:12:20 localhost kernel: Centaur CentaurHauls
Apr 6 00:12:20 localhost kernel: BIOS-provided physical RAM map:
Apr 6 00:12:20 localhost kernel: BIOS-e820: 0000000000000000 - 00000000000a0000 (usable)
Apr 6 00:12:20 localhost kernel: BIOS-e820: 0000000000100000 - 00000000cfb50000 (usable)
Apr 6 00:12:20 localhost kernel: BIOS-e820: 00000000cfb50000 - 00000000cfb66000 (reserved)
Apr 6 00:12:20 localhost kernel: BIOS-e820: 00000000cfb66000 - 00000000cfb85c00 (ACPI data)
Apr 6 00:12:20 localhost kernel: BIOS-e820: 00000000cfb85c00 - 00000000d0000000 (reserved)
Apr 6 00:12:20 localhost kernel: BIOS-e820: 00000000e0000000 - 00000000f0000000 (reserved)
Apr 6 00:12:20 localhost kernel: BIOS-e820: 00000000fe000000 - 0000000100000000 (reserved)
Apr 6 00:12:20 localhost kernel: BIOS-e820: 0000000100000000 - 0000000330000000 (usable)
Apr 6 00:12:20 localhost kernel: DMI 2.5 present.
Apr 6 00:12:20 localhost kernel: last_pfn = 0x330000 max_arch_pfn = 0x3ffffffff
Apr 6 00:12:20 localhost kernel: x86 PAT enabled: cpu 0, old 0x7040600070406, new 0x7010600070106
Apr 6 00:12:20 localhost kernel: last_pfn = 0xcfb50 max_arch_pfn = 0x3ffffffff
Apr 6 00:12:20 localhost kernel: init_memory_mapping
Apr 6 00:12:20 localhost kernel: last_map_addr: cfb50000 end: cfb50000
Apr 6 00:12:20 localhost kernel: init_memory_mapping
Apr 6 00:12:20 localhost kernel: last_map_addr: 330000000 end: 330000000
Apr 6 00:12:20 localhost kernel: RAMDISK: 37bfc000 - 37fef6c8
Apr 6 00:12:20 localhost kernel: ACPI: RSDP 000F21B0, 0024 (r2 DELL )
Apr 6 00:12:20 localhost kernel: ACPI: XSDT 000F224C, 0084 (r1 DELL PE_SC3 1 DELL 1)
Apr 6 00:12:20 localhost kernel: ACPI: FACP CFB83524, 00F4 (r3 DELL PE_SC3 1 DELL 1)
Apr 6 00:12:20 localhost kernel: ACPI: DSDT CFB66000, 4974 (r1 DELL PE_SC3 1 INTL 20050624)
Apr 6 00:12:20 localhost kernel: ACPI: FACS CFB85C00, 0040
Apr 6 00:12:20 localhost kernel: ACPI: APIC CFB83078, 00B6 (r1 DELL PE_SC3 1 DELL 1)
Apr 6 00:12:20 localhost kernel: ACPI: SPCR CFB83130, 0050 (r1 DELL PE_SC3 1 DELL 1)
Apr 6 00:12:20 localhost kernel: ACPI: HPET CFB83184, 0038 (r1 DELL PE_SC3 1 DELL 1)
Apr 6 00:12:20 localhost kernel: ACPI: MCFG CFB831C0, 003C (r1 DELL PE_SC3 1 DELL 1)
Apr 6 00:12:20 localhost kernel: ACPI: WD__ CFB83200, 0134 (r1 DELL PE_SC3 1 DELL 1)
Apr 6 00:12:20 localhost kernel: ACPI: SLIC CFB83338, 0176 (r1 DELL PE_SC3 1 DELL 1)
Apr 6 00:12:20 localhost kernel: ACPI: ERST CFB6AAF4, 0210 (r1 DELL PE_SC3 1 DELL 1)
Apr 6 00:12:20 localhost kernel: ACPI: HEST CFB6AD04, 027C (r1 DELL PE_SC3 1 DELL 1)
Apr 6 00:12:20 localhost kernel: ACPI: BERT CFB6A974, 0030 (r1 DELL PE_SC3 1 DELL 1)
Apr 6 00:12:20 localhost kernel: ACPI: EINJ CFB6A9A4, 0150 (r1 DELL PE_SC3 1 DELL 1)
Apr 6 00:12:20 localhost kernel: ACPI: TCPA CFB834BC, 0064 (r1 DELL PE_SC3 1 DELL 1)
Apr 6 00:12:20 localhost kernel: No NUMA configuration found
Apr 6 00:12:20 localhost kernel: Faking a node at 0000000000000000-0000000330000000
Apr 6 00:12:20 localhost kernel: Bootmem setup node 0 0000000000000000-0000000330000000
Apr 6 00:12:20 localhost kernel: NODE_DATA [0000000000015000 - 0000000000029fff]
Apr 6 00:12:20 localhost kernel: bootmap [000000000002a000 - 000000000008ffff] pages 66
Apr 6 00:12:20 localhost kernel: (7 early reservations) ==> bootmem [0000000000 - 0330000000]
Apr 6 00:12:20 localhost kernel: #0 [0000000000 - 0000001000] BIOS data page ==> [0000000000 - 0000001000]
Apr 6 00:12:20 localhost kernel: #1 [0000006000 - 0000008000] TRAMPOLINE ==> [0000006000 - 0000008000]
Apr 6 00:12:20 localhost kernel: #2 [0000200000 - 0000a310cc] TEXT DATA BSS ==> [0000200000 - 0000a310cc]
Apr 6 00:12:20 localhost kernel: #3 [0037bfc000 - 0037fef6c8] RAMDISK ==> [0037bfc000 - 0037fef6c8]
Apr 6 00:12:20 localhost kernel: #4 [000009f000 - 0000100000] BIOS reserved ==> [000009f000 - 0000100000]
Apr 6 00:12:20 localhost kernel: #5 [0000008000 - 000000c000] PGTABLE ==> [0000008000 - 000000c000]
Apr 6 00:12:20 localhost kernel: #6 [000000c000 - 0000015000] PGTABLE ==> [000000c000 - 0000015000]
Apr 6 00:12:20 localhost kernel: found SMP MP-table at [ffff8800000fe710] 000fe710
Apr 6 00:12:20 localhost kernel: Zone PFN ranges:
Apr 6 00:12:20 localhost kernel: DMA 0x00000000 -> 0x00001000
Apr 6 00:12:20 localhost kernel: DMA32 0x00001000 -> 0x00100000
Apr 6 00:12:20 localhost kernel: Normal 0x00100000 -> 0x00330000
Apr 6 00:12:20 localhost kernel: Movable zone start PFN for each node
Apr 6 00:12:20 localhost kernel: early_node_map[3] active PFN ranges
Apr 6 00:12:20 localhost kernel: 0: 0x00000000 -> 0x000000a0
Apr 6 00:12:20 localhost kernel: 0: 0x00000100 -> 0x000cfb50
Apr 6 00:12:20 localhost kernel: 0: 0x00100000 -> 0x00330000
Apr 6 00:12:20 localhost kernel: ACPI: PM-Timer IO Port: 0x808
Apr 6 00:12:20 localhost kernel: ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
Apr 6 00:12:20 localhost kernel: ACPI: LAPIC (acpi_id[0x02] lapic_id[0x04] enabled)
Apr 6 00:12:20 localhost kernel: ACPI: LAPIC (acpi_id[0x03] lapic_id[0x02] enabled)
Apr 6 00:12:20 localhost kernel: ACPI: LAPIC (acpi_id[0x04] lapic_id[0x06] enabled)
Apr 6 00:12:20 localhost kernel: ACPI: LAPIC (acpi_id[0x05] lapic_id[0x01] enabled)
Apr 6 00:12:20 localhost kernel: ACPI: LAPIC (acpi_id[0x06] lapic_id[0x05] enabled)
Apr 6 00:12:20 localhost kernel: ACPI: LAPIC (acpi_id[0x07] lapic_id[0x03] enabled)
Apr 6 00:12:20 localhost kernel: ACPI: LAPIC (acpi_id[0x08] lapic_id[0x07] enabled)
Apr 6 00:12:20 localhost kernel: ACPI: LAPIC_NMI (acpi_id[0xff] high edge lint[0x1])
Apr 6 00:12:20 localhost kernel: ACPI: IOAPIC (id[0x08] address[0xfec00000] gsi_base[0])
Apr 6 00:12:20 localhost kernel: IOAPIC[0]: apic_id 8, version 0, address 0xfec00000, GSI 0-23
Apr 6 00:12:20 localhost kernel: ACPI: IOAPIC (id[0x09] address[0xfec81000] gsi_base[64])
Apr 6 00:12:20 localhost kernel: IOAPIC[1]: apic_id 9, version 0, address 0xfec81000, GSI 64-87
Apr 6 00:12:20 localhost kernel: ACPI: IOAPIC (id[0x0a] address[0xfec84000] gsi_base[160])
Apr 6 00:12:20 localhost kernel: IOAPIC[2]: apic_id 10, version 0, address 0xfec84000, GSI 160-183
Apr 6 00:12:20 localhost kernel: ACPI: IOAPIC (id[0x0b] address[0xfec84800] gsi_base[224])
Apr 6 00:12:20 localhost kernel: IOAPIC[3]: apic_id 11, version 0, address 0xfec84800, GSI 224-247
Apr 6 00:12:20 localhost kernel: ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
Apr 6 00:12:20 localhost kernel: ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
Apr 6 00:12:20 localhost kernel: Setting APIC routing to flat
Apr 6 00:12:20 localhost kernel: ACPI: HPET id: 0x8086a201 base: 0xfed00000
Apr 6 00:12:20 localhost kernel: Using ACPI (MADT) for SMP configuration information
Apr 6 00:12:20 localhost kernel: SMP: Allowing 8 CPUs, 0 hotplug CPUs
Apr 6 00:12:20 localhost kernel: PM: Registered nosave memory: 00000000000a0000 - 0000000000100000
Apr 6 00:12:20 localhost kernel: PM: Registered nosave memory: 00000000cfb50000 - 00000000cfb66000
Apr 6 00:12:20 localhost kernel: PM: Registered nosave memory: 00000000cfb66000 - 00000000cfb85000
Apr 6 00:12:20 localhost kernel: PM: Registered nosave memory: 00000000cfb85000 - 00000000cfb86000
Apr 6 00:12:20 localhost kernel: PM: Registered nosave memory: 00000000cfb86000 - 00000000d0000000
Apr 6 00:12:20 localhost kernel: PM: Registered nosave memory: 00000000d0000000 - 00000000e0000000
Apr 6 00:12:20 localhost kernel: PM: Registered nosave memory: 00000000e0000000 - 00000000f0000000
Apr 6 00:12:20 localhost kernel: PM: Registered nosave memory: 00000000f0000000 - 00000000fe000000
Apr 6 00:12:20 localhost kernel: PM: Registered nosave memory: 00000000fe000000 - 0000000100000000
Apr 6 00:12:20 localhost kernel: Allocating PCI resources starting at d1000000 (gap: d0000000:10000000)
Apr 6 00:12:20 localhost kernel: PERCPU: Allocating 65184 bytes of per cpu data
Apr 6 00:12:20 localhost kernel: Built 1 zonelists in Zone order, mobility grouping on. Total pages: 3096524
Apr 6 00:12:20 localhost kernel: Policy zone: Normal
Apr 6 00:12:20 localhost kernel: Kernel command line: ro root=UUID=722ebf87-437f-4634-9c68-a82d157fa948 rhgb quiet
Apr 6 00:12:20 localhost kernel: Initializing CPU#0
Apr 6 00:12:20 localhost kernel: PID hash table entries: 4096 (order: 12, 32768 bytes)
Apr 6 00:12:20 localhost kernel: Extended CMOS year: 2000
Apr 6 00:12:20 localhost kernel: TSC: PIT calibration confirmed by PMTIMER.
Apr 6 00:12:20 localhost kernel: TSC: using PMTIMER calibration value
Apr 6 00:12:20 localhost kernel: Detected 1994.992 MHz processor.
Apr 6 00:12:20 localhost kernel: Console: colour VGA+ 80x25
Apr 6 00:12:20 localhost kernel: console [tty0] enabled
Apr 6 00:12:20 localhost kernel: Checking aperture...
Apr 6 00:12:20 localhost kernel: No AGP bridge found
Apr 6 00:12:20 localhost kernel: PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
Apr 6 00:12:20 localhost kernel: Placing software IO TLB between 0x20000000 - 0x24000000
Apr 6 00:12:20 localhost kernel: Memory: 12324244k/13369344k available (3311k kernel code, 253484k reserved, 1844k data, 1296k init)
Apr 6 00:12:20 localhost kernel: SLUB: Genslabs=13, HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1
Apr 6 00:12:20 localhost kernel: Calibrating delay loop (skipped), value calculated using timer frequency.. 3989.98 BogoMIPS (lpj=1994992)
Apr 6 00:12:20 localhost kernel: Security Framework initialized
Apr 6 00:12:20 localhost kernel: SELinux: Initializing.
Apr 6 00:12:20 localhost kernel: Dentry cache hash table entries: 2097152 (order: 12, 16777216 bytes)
Apr 6 00:12:20 localhost kernel: Inode-cache hash table entries: 1048576 (order: 11, 8388608 bytes)
Apr 6 00:12:20 localhost kernel: Mount-cache hash table entries: 256
Apr 6 00:12:20 localhost kernel: Initializing cgroup subsys ns
Apr 6 00:12:20 localhost kernel: Initializing cgroup subsys cpuacct
Apr 6 00:12:20 localhost kernel: Initializing cgroup subsys devices
Apr 6 00:12:20 localhost kernel: CPU: L1 I cache: 32K, L1 D cache: 32K
Apr 6 00:12:20 localhost kernel: CPU: L2 cache: 4096K
Apr 6 00:12:20 localhost kernel: CPU 0/0 -> Node 0
Apr 6 00:12:20 localhost kernel: CPU: Physical Processor ID: 0
Apr 6 00:12:20 localhost kernel: CPU: Processor Core ID: 0
Apr 6 00:12:20 localhost kernel: CPU0: Thermal monitoring enabled (TM1)
Apr 6 00:12:20 localhost kernel: using mwait in idle threads.
Apr 6 00:12:20 localhost kernel: ACPI: Core revision 20080609
Apr 6 00:12:20 localhost kernel: ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
Apr 6 00:12:20 localhost kernel: CPU0: Intel(R) Xeon(R) CPU E5335 @ 2.00GHz stepping 07
Apr 6 00:12:20 localhost kernel: Using local APIC timer interrupts.
Apr 6 00:12:20 localhost kernel: Detected 20.781 MHz APIC timer.
Apr 6 00:12:20 localhost kernel: Booting processor 1/4 ip 6000
Apr 6 00:12:20 localhost kernel: Initializing CPU#1
Apr 6 00:12:20 localhost kernel: Calibrating delay using timer specific routine.. 3990.05 BogoMIPS (lpj=1995026)
Apr 6 00:12:20 localhost kernel: CPU: L1 I cache: 32K, L1 D cache: 32K
Apr 6 00:12:20 localhost kernel: CPU: L2 cache: 4096K
Apr 6 00:12:20 localhost kernel: CPU 1/4 -> Node 0
Apr 6 00:12:20 localhost kernel: CPU: Physical Processor ID: 1
Apr 6 00:12:20 localhost kernel: CPU: Processor Core ID: 0
Apr 6 00:12:20 localhost kernel: CPU1: Thermal monitoring enabled (TM2)
Apr 6 00:12:20 localhost kernel: x86 PAT enabled: cpu 1, old 0x7040600070406, new 0x7010600070106
Apr 6 00:12:20 localhost kernel: CPU1: Intel(R) Xeon(R) CPU E5335 @ 2.00GHz stepping 07
Apr 6 00:12:20 localhost kernel: checking TSC synchronization [CPU#0 -> CPU#1]: passed.
Apr 6 00:12:20 localhost kernel: Booting processor 2/2 ip 6000
Apr 6 00:12:20 localhost kernel: Initializing CPU#2
Apr 6 00:12:20 localhost kernel: Calibrating delay using timer specific routine.. 3990.05 BogoMIPS (lpj=1995029)
We have a dedicated MySQL server and below is the a snapshot of the top. The load average has been staying at nearly 100 for an hour plus ready.
top - 20:54:28 up 7:31, 2 users, load average: 83.08, 96.88, 106.23
Tasks: 278 total, 2 running, 274 sleeping, 2 stopped, 0 zombie
Cpu0 : 18.8%us, 10.2%sy, 0.0%ni, 70.9%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu1 : 51.2%us, 4.3%sy, 0.0%ni, 44.2%id, 0.0%wa, 0.0%hi, 0.3%si, 0.0%st
Cpu2 : 9.0%us, 10.3%sy, 0.0%ni, 80.6%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu3 : 18.8%us, 7.4%sy, 0.0%ni, 73.8%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu4 : 7.8%us, 8.8%sy, 0.0%ni, 83.4%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu5 : 10.3%us, 8.4%sy, 0.0%ni, 81.4%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu6 : 6.2%us, 7.5%sy, 0.0%ni, 86.2%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu7 : 6.2%us, 6.2%sy, 0.0%ni, 87.3%id, 0.0%wa, 0.0%hi, 0.3%si, 0.0%st
Cpu8 : 8.8%us, 10.4%sy, 0.0%ni, 80.5%id, 0.0%wa, 0.0%hi, 0.3%si, 0.0%st
Cpu9 : 63.7%us, 4.6%sy, 0.0%ni, 12.2%id, 0.0%wa, 4.3%hi, 15.2%si, 0.0%st
Cpu10 : 9.2%us, 10.2%sy, 0.0%ni, 80.6%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu11 : 17.3%us, 5.9%sy, 0.0%ni, 76.8%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu12 : 8.0%us, 8.7%sy, 0.0%ni, 83.3%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu13 : 10.9%us, 7.4%sy, 0.0%ni, 81.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu14 : 6.2%us, 6.9%sy, 0.0%ni, 86.9%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu15 : 4.8%us, 6.1%sy, 0.0%ni, 89.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 33009800k total, 23174396k used, 9835404k free, 120604k buffers
Swap: 35061752k total, 0k used, 35061752k free, 16459540k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3341 mysql 20 0 14.3g 4.6g 4240 S 417.8 14.5 1673:51 mysqld
24406 root 20 0 15008 1292 876 R 0.3 0.0 0:00.19 top
1 root 20 0 4080 852 608 S 0.0 0.0 0:01.92 init
2 root 15 -5 0 0 0 S 0.0 0.0 0:00.00 kthreadd
3 root RT -5 0 0 0 S 0.0 0.0 0:00.32 migration/0
4 root 15 -5 0 0 0 S 0.0 0.0 0:00.29 ksoftirqd/0
5 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
6 root RT -5 0 0 0 S 0.0 0.0 0:03.21 migration/1
7 root 15 -5 0 0 0 S 0.0 0.0 0:00.07 ksoftirqd/1
8 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/1
9 root RT -5 0 0 0 S 0.0 0.0 0:00.17 migration/2
10 root 15 -5 0 0 0 S 0.0 0.0 0:00.03 ksoftirqd/2
11 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/2
12 root RT -5 0 0 0 S 0.0 0.0 0:00.32 migration/3
13 root 15 -5 0 0 0 S 0.0 0.0 0:00.02 ksoftirqd/3
14 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/3
15 root RT -5 0 0 0 S 0.0 0.0 0:00.10 migration/4
16 root 15 -5 0 0 0 S 0.0 0.0 0:00.04 ksoftirqd/4
17 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/4
18 root RT -5 0 0 0 S 0.0 0.0 0:00.35 migration/5
We have also tried to run this command. What else command can help us diagnose the exact problem of this high load?
netstat -nat |grep 3306 | awk '{print $6}' | sort | uniq -c | sort -n
1 LISTEN
1 SYN_RECV
410 ESTABLISHED
964 TIME_WAIT
Output of vmstat 1
:
---------------memory--------------- --swap-- --io-- --system-- -----cpu------
r b swpd free buff cache si so bi bo in cs us sy id wa st
2 0 0 12978936 30944 15172360 0 0 259 3 184 265 6 6 77 12 0
I would like the know in what cpus % can be considered in save range and also load average? Which indication will give signal something is wrong with the server?
top - 22:55:51 up 3 days, 6:39, 1 user, load average: 0.53, 0.43, 0.37
Tasks: 229 total, 2 running, 227 sleeping, 0 stopped, 0 zombie
Cpu0 : 16.2%us, 0.7%sy, 0.0%ni, 82.8%id, 0.0%wa, 0.0%hi, 0.3%si, 0.0%st
Cpu1 : 10.5%us, 0.7%sy, 0.0%ni, 88.5%id, 0.0%wa, 0.0%hi, 0.3%si, 0.0%st
Cpu2 : 9.0%us, 0.0%sy, 0.0%ni, 91.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu3 : 0.3%us, 0.3%sy, 0.0%ni, 99.4%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu4 : 1.0%us, 0.0%sy, 0.0%ni, 99.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu5 : 44.8%us, 2.6%sy, 0.0%ni, 37.0%id, 0.0%wa, 9.4%hi, 6.2%si, 0.0%st
Cpu6 : 3.0%us, 0.0%sy, 0.0%ni, 96.7%id, 0.0%wa, 0.0%hi, 0.4%si, 0.0%st
Cpu7 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 16468596k total, 2423908k used, 14044688k free, 200172k buffers
I have CentOS machine and each time I've noticed that the server loses correct time after a while. It is usually behind by several minutes after time passes from having manually set the correct time. Is there a mechanism whereby I can update the server with the time from a specific time server?
I have enabled my slow query log. So I saw the query which was taking some time then I did some indexing it improve and my slow query log is not being showing any more queies. But when I run this command
mysqladmin -u root -p status
Enter password:
Uptime: 9395 Threads: 2 Questions: 474976 Slow queries: 13 Opens: 99 Flush tables: 1 Open tables: 54 Queries per second avg: 50.556
It is showing me slow queries:13. What does the thread n questions means here?
Here is how I set my.cnf
file.
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
log-slow-queries = /var/log/mysql/mysql-slow.log
long_query_time = 2
log_warnings = 2
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
I have a java application which I run using yasjw tool as a daemon. I need to monitor it in case it goes down I need some kind of alert or even restart it. Is there any tool can help me do this on centos environment?
The results of ps -ef | grep java
root 3109 1 0 Apr06 ? 00:04:35 /usr/java/jdk1.6.0_18/bin/java -Dwrapper.pidfile=/var/run/wrapper.commServer.pid -Dwrapper.service=true -Dwrapper.visible=false -jar /usr/local/yajsw-beta-10.2/wrapper.jar -c /usr/local/yajsw-beta-10.2/conf/wrapper.conf
root 3132 3109 0 Apr06 ? 00:25:26 /usr/java/jdk1.6.0_18/bin/java -classpath /usr/local/yajsw-beta-10.2/./wrapperApp.jar:/usr/local -Xrs -Dwrapper.service=true -Dwrapper.console.visible=false -Dwrapper.visible=false -Dwrapper.pidfile=/var/run/wrapper.commServer.pid -Dwrapper.config=/usr/local/yajsw-beta-10.2/conf/wrapper.conf -Dwrapper.port=15003 -Dwrapper.key=4276015160565963367 -Dwrapper.teeName=4276015160565963367$1333699547154 -Dwrapper.tmpPath=/tmp org.rzo.yajsw.app.WrapperJVMMain
root 23986 23945 0 16:53 pts/0 00:00:00 grep java
pidof java
3132 3109