Sigar是Hyperic-hq产品的基础包,是Hyperic HQ主要的数据收集组件。它用来从许多平台收集系统和处理信息.

这些平台包括:Linux, Windows, Solaris, AIX, HP-UX, FreeBSD and Mac OSX.

Sigar有C,C#,Java和Perl API,java版的API为sigar.jar sigar.jar的底层是用C语言编写的,它通过本地方法来调用操作系统API来获取系统相关数据。Windows操作系统下Sigar.jar 依赖sigar-amd64-winnt.dll或sigar-x86-winnt.dll,linux 操作系统下则依赖libsigar-amd64-linux.so或libsigar-x86-linux.so

由于每个平台都要依赖.dll 所以的GitHub上发现了oshi

添加maven

<dependency>
<groupId>com.github.oshi</groupId>
<artifactId>oshi-core</artifactId>
<version>3.4.4</version>
</dependency>

编写测试类

package com.sundablog.utlis;
import java.util.Arrays;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import oshi.SystemInfo;
import oshi.hardware.Baseboard;
import oshi.hardware.CentralProcessor;
import oshi.hardware.CentralProcessor.TickType;
import oshi.hardware.ComputerSystem;
import oshi.hardware.Display;
import oshi.hardware.Firmware;
import oshi.hardware.GlobalMemory;
import oshi.hardware.HWDiskStore;
import oshi.hardware.HWPartition;
import oshi.hardware.HardwareAbstractionLayer;
import oshi.hardware.NetworkIF;
import oshi.hardware.PowerSource;
import oshi.hardware.Sensors;
import oshi.hardware.UsbDevice;
import oshi.software.os.FileSystem;
import oshi.software.os.NetworkParams;
import oshi.software.os.OSFileStore;
import oshi.software.os.OSProcess;
import oshi.software.os.OperatingSystem;
import oshi.software.os.OperatingSystem.ProcessSort;
import oshi.util.FormatUtil;
import oshi.util.Util;
/**
* Java系统监控测试类
* @ClassName: SystemInfoTest
* @Description:TODO(这里用一句话描述这个类的作用)
* @author: 哒哒
* @date: 2018年3月1日 下午5:33:51
*
* @Copyright: 2018 www.sundablog.com Inc. All rights reserved.
*/
public class SystemInfoTest {
private static void printComputerSystem(final ComputerSystem computerSystem) {
System.out.println("manufacturer: " + computerSystem.getManufacturer());
System.out.println("model: " + computerSystem.getModel());
System.out.println("serialnumber: " + computerSystem.getSerialNumber());
final Firmware firmware = computerSystem.getFirmware();
System.out.println("firmware:");
System.out.println(" manufacturer: " + firmware.getManufacturer());
System.out.println(" name: " + firmware.getName());
System.out.println(" description: " + firmware.getDescription());
System.out.println(" version: " + firmware.getVersion());
System.out.println(" release date: " + (firmware.getReleaseDate() == null ? "unknown"
: firmware.getReleaseDate() == null ? "unknown" : FormatUtil.formatDate(firmware.getReleaseDate())));
final Baseboard baseboard = computerSystem.getBaseboard();
System.out.println("baseboard:");
System.out.println(" manufacturer: " + baseboard.getManufacturer());
System.out.println(" model: " + baseboard.getModel());
System.out.println(" version: " + baseboard.getVersion());
System.out.println(" serialnumber: " + baseboard.getSerialNumber());
}
private static void printProcessor(CentralProcessor processor) {
System.out.println(processor);
System.out.println(" " + processor.getPhysicalProcessorCount() + " physical CPU(s)");
System.out.println(" " + processor.getLogicalProcessorCount() + " logical CPU(s)");
System.out.println("Identifier: " + processor.getIdentifier());
System.out.println("ProcessorID: " + processor.getProcessorID());
}
private static void printMemory(GlobalMemory memory) {
System.out.println("以使用内存: " + FormatUtil.formatBytes(memory.getAvailable()) + "总共内存"
+ FormatUtil.formatBytes(memory.getTotal()));
System.out.println("Swap used: " + FormatUtil.formatBytes(memory.getSwapUsed()) + "/"
+ FormatUtil.formatBytes(memory.getSwapTotal()));
}
private static void printCpu(CentralProcessor processor) {
System.out.println("Uptime: " + FormatUtil.formatElapsedSecs(processor.getSystemUptime()));
long[] prevTicks = processor.getSystemCpuLoadTicks();
System.out.println("CPU, IOWait, and IRQ ticks @ 0 sec:" + Arrays.toString(prevTicks));
// Wait a second...
Util.sleep(1000);
long[] ticks = processor.getSystemCpuLoadTicks();
System.out.println("CPU, IOWait, and IRQ ticks @ 1 sec:" + Arrays.toString(ticks));
long user = ticks[TickType.USER.getIndex()] - prevTicks[TickType.USER.getIndex()];
long nice = ticks[TickType.NICE.getIndex()] - prevTicks[TickType.NICE.getIndex()];
long sys = ticks[TickType.SYSTEM.getIndex()] - prevTicks[TickType.SYSTEM.getIndex()];
long idle = ticks[TickType.IDLE.getIndex()] - prevTicks[TickType.IDLE.getIndex()];
long iowait = ticks[TickType.IOWAIT.getIndex()] - prevTicks[TickType.IOWAIT.getIndex()];
long irq = ticks[TickType.IRQ.getIndex()] - prevTicks[TickType.IRQ.getIndex()];
long softirq = ticks[TickType.SOFTIRQ.getIndex()] - prevTicks[TickType.SOFTIRQ.getIndex()];
long steal = ticks[TickType.STEAL.getIndex()] - prevTicks[TickType.STEAL.getIndex()];
long totalCpu = user + nice + sys + idle + iowait + irq + softirq + steal;
System.out.format(
"User: %.1f%% Nice: %.1f%% System: %.1f%% Idle: %.1f%% IOwait: %.1f%% IRQ: %.1f%% SoftIRQ: %.1f%% Steal: %.1f%%%n",
100d * user / totalCpu, 100d * nice / totalCpu, 100d * sys / totalCpu, 100d * idle / totalCpu,
100d * iowait / totalCpu, 100d * irq / totalCpu, 100d * softirq / totalCpu, 100d * steal / totalCpu);
System.out.format("CPU load: %.1f%% (counting ticks)%n", processor.getSystemCpuLoadBetweenTicks() * 100);
System.out.format("CPU load: %.1f%% (OS MXBean)%n", processor.getSystemCpuLoad() * 100);
double[] loadAverage = processor.getSystemLoadAverage(3);
System.out.println("CPU load averages:" + (loadAverage[0] < 0 ? " N/A" : String.format(" %.2f", loadAverage[0]))
+ (loadAverage[1] < 0 ? " N/A" : String.format(" %.2f", loadAverage[1]))
+ (loadAverage[2] < 0 ? " N/A" : String.format(" %.2f", loadAverage[2])));
// per core CPU
StringBuilder procCpu = new StringBuilder("CPU load per processor:");
double[] load = processor.getProcessorCpuLoadBetweenTicks();
for (double avg : load) {
procCpu.append(String.format(" %.1f%%", avg * 100));
}
System.out.println(procCpu.toString());
}
private static void printProcesses(OperatingSystem os, GlobalMemory memory) {
System.out.println("Processes: " + os.getProcessCount() + ", Threads: " + os.getThreadCount());
// Sort by highest CPU
List<OSProcess> procs = Arrays.asList(os.getProcesses(5, ProcessSort.CPU));
System.out.println(" PID %CPU %MEM VSZ RSS Name");
for (int i = 0; i < procs.size() && i < 5; i++) {
OSProcess p = procs.get(i);
System.out.format(" %5d %5.1f %4.1f %9s %9s %s%n", p.getProcessID(),
100d * (p.getKernelTime() + p.getUserTime()) / p.getUpTime(),
100d * p.getResidentSetSize() / memory.getTotal(), FormatUtil.formatBytes(p.getVirtualSize()),
FormatUtil.formatBytes(p.getResidentSetSize()), p.getName());
}
}
private static void printSensors(Sensors sensors) {
System.out.println("Sensors:");
System.out.format(" CPU Temperature: %.1f°C%n", sensors.getCpuTemperature());
System.out.println(" Fan Speeds: " + Arrays.toString(sensors.getFanSpeeds()));
System.out.format(" CPU Voltage: %.1fV%n", sensors.getCpuVoltage());
}
private static void printPowerSources(PowerSource[] powerSources) {
StringBuilder sb = new StringBuilder("Power: ");
if (powerSources.length == 0) {
sb.append("Unknown");
} else {
double timeRemaining = powerSources[0].getTimeRemaining();
if (timeRemaining < -1d) {
sb.append("Charging");
} else if (timeRemaining < 0d) {
sb.append("Calculating time remaining");
} else {
sb.append(String.format("%d:%02d remaining", (int) (timeRemaining / 3600),
(int) (timeRemaining / 60) % 60));
}
}
for (PowerSource pSource : powerSources) {
sb.append(String.format("%n %s @ %.1f%%", pSource.getName(), pSource.getRemainingCapacity() * 100d));
}
System.out.println(sb.toString());
}
private static void printDisks(HWDiskStore[] diskStores) {
System.out.println("Disks:");
for (HWDiskStore disk : diskStores) {
boolean readwrite = disk.getReads() > 0 || disk.getWrites() > 0;
System.out.format(" %s: (model: %s - S/N: %s) size: %s, reads: %s (%s), writes: %s (%s), xfer: %s ms%n",
disk.getName(), disk.getModel(), disk.getSerial(),
disk.getSize() > 0 ? FormatUtil.formatBytesDecimal(disk.getSize()) : "?",
readwrite ? disk.getReads() : "?", readwrite ? FormatUtil.formatBytes(disk.getReadBytes()) : "?",
readwrite ? disk.getWrites() : "?", readwrite ? FormatUtil.formatBytes(disk.getWriteBytes()) : "?",
readwrite ? disk.getTransferTime() : "?");
HWPartition[] partitions = disk.getPartitions();
if (partitions == null) {
// TODO Remove when all OS's implemented
continue;
}
for (HWPartition part : partitions) {
System.out.format(" |-- %s: %s (%s) Maj:Min=%d:%d, size: %s%s%n", part.getIdentification(),
part.getName(), part.getType(), part.getMajor(), part.getMinor(),
FormatUtil.formatBytesDecimal(part.getSize()),
part.getMountPoint().isEmpty() ? "" : " @ " + part.getMountPoint());
}
}
}
private static void printFileSystem(FileSystem fileSystem) {
System.out.println("File System:");
System.out.format(" File Descriptors: %d/%d%n", fileSystem.getOpenFileDescriptors(),
fileSystem.getMaxFileDescriptors());
OSFileStore[] fsArray = fileSystem.getFileStores();
for (OSFileStore fs : fsArray) {
long usable = fs.getUsableSpace();
long total = fs.getTotalSpace();
System.out.format(
" %s (%s) [%s] %s of %s free (%.1f%%) is %s "
+ (fs.getLogicalVolume() != null && fs.getLogicalVolume().length() > 0 ? "[%s]" : "%s")
+ " and is mounted at %s%n",
fs.getName(), fs.getDescription().isEmpty() ? "file system" : fs.getDescription(), fs.getType(),
FormatUtil.formatBytes(usable), FormatUtil.formatBytes(fs.getTotalSpace()), 100d * usable / total,
fs.getVolume(), fs.getLogicalVolume(), fs.getMount());
}
}
private static void printNetworkInterfaces(NetworkIF[] networkIFs) {
System.out.println("Network interfaces:");
for (NetworkIF net : networkIFs) {
System.out.format(" Name: %s (%s)%n", net.getName(), net.getDisplayName());
System.out.format(" MAC Address: %s %n", net.getMacaddr());
System.out.format(" MTU: %s, Speed: %s %n", net.getMTU(), FormatUtil.formatValue(net.getSpeed(), "bps"));
System.out.format(" IPv4: %s %n", Arrays.toString(net.getIPv4addr()));
System.out.format(" IPv6: %s %n", Arrays.toString(net.getIPv6addr()));
boolean hasData = net.getBytesRecv() > 0 || net.getBytesSent() > 0 || net.getPacketsRecv() > 0
|| net.getPacketsSent() > 0;
System.out.format(" Traffic: received %s/%s%s; transmitted %s/%s%s %n",
hasData ? net.getPacketsRecv() + " packets" : "?",
hasData ? FormatUtil.formatBytes(net.getBytesRecv()) : "?",
hasData ? " (" + net.getInErrors() + " err)" : "",
hasData ? net.getPacketsSent() + " packets" : "?",
hasData ? FormatUtil.formatBytes(net.getBytesSent()) : "?",
hasData ? " (" + net.getOutErrors() + " err)" : "");
}
}
private static void printNetworkParameters(NetworkParams networkParams) {
System.out.println("Network parameters:");
System.out.format(" Host name: %s%n", networkParams.getHostName());
System.out.format(" Domain name: %s%n", networkParams.getDomainName());
System.out.format(" DNS servers: %s%n", Arrays.toString(networkParams.getDnsServers()));
System.out.format(" IPv4 Gateway: %s%n", networkParams.getIpv4DefaultGateway());
System.out.format(" IPv6 Gateway: %s%n", networkParams.getIpv6DefaultGateway());
}
private static void printDisplays(Display[] displays) {
System.out.println("Displays:");
int i = 0;
for (Display display : displays) {
System.out.println(" Display " + i + ":");
System.out.println(display.toString());
i++;
}
}
private static void printUsbDevices(UsbDevice[] usbDevices) {
System.out.println("USB Devices:");
for (UsbDevice usbDevice : usbDevices) {
System.out.println(usbDevice.toString());
}
}
public static void main(String[] args) {
Logger LOG = LoggerFactory.getLogger(SystemInfoTest.class);
LOG.info("Initializing System...");
SystemInfo si = new SystemInfo();
HardwareAbstractionLayer hal = si.getHardware();
OperatingSystem os = si.getOperatingSystem();
System.out.println(os);
LOG.info("Checking computer system...");
printComputerSystem(hal.getComputerSystem());
LOG.info("Checking Processor...");
printProcessor(hal.getProcessor());
LOG.info("Checking Memory...");
printMemory(hal.getMemory());
LOG.info("Checking CPU...");
printCpu(hal.getProcessor());
LOG.info("Checking Processes...");
printProcesses(os, hal.getMemory());
LOG.info("Checking Sensors...");
printSensors(hal.getSensors());
LOG.info("Checking Power sources...");
printPowerSources(hal.getPowerSources());
LOG.info("Checking Disks...");
printDisks(hal.getDiskStores());
LOG.info("Checking File System...");
printFileSystem(os.getFileSystem());
LOG.info("Checking Network interfaces...");
printNetworkInterfaces(hal.getNetworkIFs());
LOG.info("Checking Network parameterss...");
printNetworkParameters(os.getNetworkParams());
// hardware: displays
LOG.info("Checking Displays...");
printDisplays(hal.getDisplays());
// hardware: USB devices
LOG.info("Checking USB Devices...");
printUsbDevices(hal.getUsbDevices(true));
}
}

运行结果

log4j:WARN No appenders could be found for logger (com.sundablog.utlis.SystemInfoTest).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Apple macOS 10.13.3 (High Sierra) build 17D47
manufacturer: Apple Inc.
model: MacBook Pro (MacBookPro11,2)
serialnumber: C02P91B3G3QC
firmware:
manufacturer: Apple Inc.
name: EFI
description: unknown
version: MBP112.0142.B00
release date: unknown
baseboard:
manufacturer: Apple Inc.
model: SMC
version: 2.18f15
serialnumber: C02P91B3G3QC
Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
4 physical CPU(s)
8 logical CPU(s)
Identifier: Intel64 Family 6 Model 70 Stepping 1
ProcessorID: BFEBFBFF00040661
以使用内存: 6.6 GiB总共内存16 GiB
Swap used: 0 bytes/0 bytes
Uptime: 0 days, 07:58:21
CPU, IOWait, and IRQ ticks @ 0 sec:[839666, 0, 372626, 10847395, 0, 0, 0, 0]
CPU, IOWait, and IRQ ticks @ 1 sec:[839753, 0, 372649, 10848088, 0, 0, 0, 0]
User: 10.8% Nice: 0.0% System: 2.9% Idle: 86.3% IOwait: 0.0% IRQ: 0.0% SoftIRQ: 0.0% Steal: 0.0%
CPU load: 14.3% (counting ticks)
CPU load: 14.3% (OS MXBean)
CPU load averages: 3.57 2.64 2.48
CPU load per processor: 27.2% 3.9% 23.5% 4.0% 21.6% 4.9% 25.5% 3.9%
Processes: 345, Threads: 772
PID %CPU %MEM VSZ RSS Name
1430 47.1 0.3 9.6 GiB 56.9 MiB java
1361 19.1 1.1 5.3 GiB 183.3 MiB Google Chrome Helper
1112 16.5 3.5 6.0 GiB 566.1 MiB Google Chrome Helper
1101 13.8 10.8 9.2 GiB 1.7 GiB eclipse
700 7.9 1.8 5.2 GiB 294.2 MiB Google Chrome
Sensors:
CPU Temperature: 52.5°C
Fan Speeds: [2157, 2000]
CPU Voltage: 3.7V
Power: Charging
InternalBattery-0 @ 100.0%
Disks:
disk0: (model: APPLE SSD SM0256F - S/N: S1K4NYCG163027) size: 251.0 GB, reads: 192337 (5.4 GiB), writes: 195838 (2.6 GiB), xfer: 134350 ms
|-- disk0s1: EFI (EFI System Partition) Maj:Min=1:1, size: 209.7 MB
|-- disk0s2: Untitled 2 (Untitled 2) Maj:Min=1:2, size: 250.8 GB
disk1: (model: APPLE SSD SM0256F - S/N: S1K4NYCG163027) size: 250.8 GB, reads: ? (?), writes: ? (?), xfer: ? ms
|-- disk1s1: sunda (sunda) Maj:Min=1:4, size: 250.8 GB @ /
|-- disk1s2: Preboot (Preboot) Maj:Min=1:6, size: 250.8 GB
|-- disk1s3: Recovery (Recovery) Maj:Min=1:5, size: 250.8 GB
|-- disk1s4: VM (VM) Maj:Min=1:7, size: 250.8 GB @ /private/var/vm
disk2: (model: Disk Image - S/N: ) size: 66.6 MB, reads: 172 (23.8 MiB), writes: 0 (0 bytes), xfer: 2854 ms
|-- disk2s1: Lantern 4.4.2 (disk image) Maj:Min=1:9, size: 66.5 MB @ /Volumes/Lantern 4.4.2
File System:
File Descriptors: 4017/49152
sunda (Volume) [apfs] 191.1 GiB of 233.6 GiB free (81.8%) is /dev/disk1s1 and is mounted at /
VM (Volume) [apfs] 191.1 GiB of 233.6 GiB free (81.8%) is /dev/disk1s4 and is mounted at /private/var/vm
Lantern 4.4.2 (Volume) [hfs] 40.1 MiB of 63.5 MiB free (63.3%) is /dev/disk2s1 and is mounted at /Volumes/Lantern 4.4.2
Network interfaces:
Name: en3 (en3)
MAC Address: 9c:eb:e8:22:d3:e1
MTU: 1500, Speed: 100 Mbps
IPv4: [192.168.2.103]
IPv6: [fe80:0:0:0:c17:690e:4922:2a0a]
Traffic: received 412320 packets/377.0 MiB (0 err); transmitted 400139 packets/55.9 MiB (14 err)
Network parameters:
Host name: localhost
Domain name:
DNS servers: [192.168.2.1, 0.0.0.0]
IPv4 Gateway: 192.168.2.1
IPv6 Gateway: fe80::
Displays:
Display 0:
Manuf. ID=A, Product ID=a022, Analog, Serial=00000000, ManufDate=1/2013, EDID v1.4
33 x 21 cm (13.0 x 8.3 in)
Preferred Timing: Clock -317MHz, Active Pixels 3840x1920
Monitor Name: Color LCD
Preferred Timing: Clock 0MHz, Active Pixels 0x0
Preferred Timing: Clock 0MHz, Active Pixels 0x0
USB Devices:
AppleUSBXHCI
|-- AppleUSBXHCI Root Hub Simulation (Apple Inc.)
|-- Apple Internal Keyboard / Trackpad (Apple Inc.)
|-- BRCM20702 Hub (Apple Inc.)
|-- Bluetooth USB Host Controller (Apple Inc.)
|-- USB 10/100 LAN (Xiaomi) [s/n: 9CEBE822D3E1]

公众号

如果大家想要实时关注我更新的文章以及分享的干货的话,可以关注我的公众号。

Java系统监控(淘汰sigar)的更多相关文章

  1. java系统监控分析Jprofile下载及安装配置【转】

    JProfiler是一个全功能的Java剖析工具(profiler),专用於分析J2SE和J2EE应用程式.它把CPU.线程和记忆体的剖析组合在一个强大的应用中.JProfiler可提供许多IDE整合 ...

  2. ava如何实现系统监控、系统信息收集、sigar开源API的学习(转)

    ava如何实现系统监控.系统信息收集.sigar开源API的学习(转) 转自:http://liningjustsoso.iteye.com/blog/1254584 首先给大家介绍一个开源工具Sig ...

  3. Java如何实现系统监控、系统信息收集(转

    Java如何实现系统监控.系统信息收集.sigar开源API的学习 系统监控(1) Jar资源下载:http://download.csdn.net/detail/yixiaoping/4903853 ...

  4. Linux系统监控命令及如何定位到Java线程

    >>PID.TID的区分 uid是user id,即用户id,root用户的uid是0,0为最高权限,gid是group id,用户组id,使用 id 命令可以很简单的通过用户名查看UID ...

  5. 性能调优之Java系统级性能监控及优化

    性能调优之Java系统级性能监控及优化   对于性能调优而言,通常我们需要经过以下三个步骤:1,性能监控:2,性能剖析:3,性能调优 性能调优:通过分析影响Application性能问题根源,进行优化 ...

  6. Linux系统监控命令及定位Java线程

    1.PID.TID的区分 uid是user id,即用户id,root用户的uid是0,0为最高权限,gid是group id,用户组id,使用 id 命令可以很简单的通过用户名查看UID.GID:~ ...

  7. Ubuntu系统监控cpu memery 磁盘Io次数 IO速率 网卡 运行时间等信息的采集

    实验室最近在做的项目要做ubuntu系统监控,要获得系统的一些信息并返回给web服务器. web服务器与ubuntu主机的通信我写的程序用的是socket,至于为什么不用java程序ssh到对应的主机 ...

  8. StatsD!次世代系统监控的核心

    在互联网业务蒸蒸日上的今时今日,系统架构日渐复杂,随着软件产品和工程团队的变革,许多开源的监控工具应运而生,其中有一些相当出名,比如 Zabbix.Nagios 还有 StatsD.也有一些问题被大家 ...

  9. Tomcat java zabbix 监控

    排除汤姆猫错误的步骤 ps-ef | grep java或jps –lvm 查看java pid进程 netstat –lntup | grep java 查看java 端口有没有启动 查看 tomc ...

随机推荐

  1. jinja2.exceptions.TemplateNotFound: home/index.html

    问题: 检查路由路径和模版渲染方式,其他文件路径都正确,可以返回字符串,就是无法返回定义的模版,为什么flask无法启找到这个模版? 那,问题原因在哪? 在flask中,目录有着严格的定义,模版目录必 ...

  2. Effective Java 第三版——30. 优先使用泛型方法

    Tips <Effective Java, Third Edition>一书英文版已经出版,这本书的第二版想必很多人都读过,号称Java四大名著之一,不过第二版2009年出版,到现在已经将 ...

  3. Failed to connect to VMware Lookup Service……SSL certificate verification failed

    今天登陆vsphere web-client时候,报错如下: Failed to connect to VMware Lookup Service https://vc-test.cebbank.co ...

  4. tomcat监控(二)

    标签: linux 笔者Q:972581034 交流群:605799367.有任何疑问可与笔者或加群交流 这里介绍二种监控Tomcat的方法 使用windows版本的jdk监控 使用zabbix监控 ...

  5. Android开发——打造简单的Viewpager指示器

    准备工作: 1.两张不同颜色的小圆点图片,可以去阿里巴巴矢量图网站搜索 我把我使用的图片贴出来 2.一个简单的Viewpager的实现 下面是简单的Viewpager实现步骤: 1.布局文件使用Vie ...

  6. 【Thinkphp 5】 整合邮箱类 phpmailer实现邮件发送

    第一步:下载phpmailer文件,主要用到的文件只有箭头指向的两个,thinkphp5中,把class.phpmailer.php改成了phpmailer.php 第二步: 将phpmailer文件 ...

  7. 关于word图片显示不全

    问题:在编辑word时,在其中一行插入一张图片,但是显示不全. 原因:给文字行距设置成 [ 固定值 ]的原因. 解决方案:先删除图片,在插入图片的一行右键--> 段落,弹出对话框,找到设置行距的 ...

  8. python编码的那些事

    字符串编码在python里是经常会遇到的问题,特别是写文件或是网络传输调用某些函数的时候. 现在来看看python中的unicode编码和utf-8编码 字符串编码的历史 计算机只能处理数字,文本转换 ...

  9. Sonar 数据库表关系整理一(续)

    更多原创测试技术文章同步更新到微信公众号 :三国测,敬请扫码关注个人的微信号,感谢! 简介:Sonar平台是目前较为流行的静态代码扫描平台,为了便于使用以及自己二次开发,有必要对它的数据库结构进行学习 ...

  10. 全部用startssl生成的证书,配置Apache使其支持SSL

    Apache的编译安装见这篇: http://www.cnblogs.com/yjken/p/3921840.html 网上查阅了一大批资料,得知自己生成的证书是会被浏览器提示“证书不安全”的,我也就 ...