存档
freebsd apache
1.报错Freebsd: No such file or directory: Failed to enable the ‘httpready’ Accept Filter
载入模块
vivi#kldload accf_http
vivi#kldload accf_data
重启apache就好了
2.vivi# ./apachectl -k start 无提示,80端口未开
查看日志
vivi# cat /var/log/httpd-error.log
[Sat Mar 27 22:09:46 2010] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of “vivi”
编辑/usr/local/etc/apache22/httpd.conf
注释这行 #LoadModule unique_id_module libexec/apache22/mod_unique_id.so
打开/etc/rc.conf设置:
accf_data_load=”YES”
accf_http_load=”YES”
apache22_enable=”YES”
安装、更新ports
对比更新 vbs
- Option Explicit
- sub copyfol(sDir,Ddir)
- 'sDiry要对比的文件夹,,Ddir要操作文件夹
- dim fso,fol,fs,f1, objfile
- dim arrFiles(),arrSize(),arrModified()
- dim i
- if right(ddir,1)<>"\" then ddir =ddir & "\"
- if right(sdir,1)<>"\" then sdir =sdir & "\"
- Set fso = CreateObject("Scripting.FileSystemObject")
- '判断文件是否存在
- if not (fso.FolderExists(sdir)) then
- msgbox "找不到文件夹:" & sdir
- exit sub
- end if
- if not (fso.FolderExists(ddir)) then
- msgbox "找不到文件夹:" & sdir
- exit sub
- end if
- '获得要操作的文件列表及相关信息并储存到数组
- set fol=fso.GetFolder(ddir)
- set fs=fol.files
- i=0
- redim arrFiles(fs.count-1)
- redim arrSize(fs.count-1)
- redim arrModified(fs.count-1)
- for each f1 in fs
- arrfiles(i)=f1.name
- arrSize(i)=f1.size
- arrModified(i)=f1.DateLastModified
- i=i+1
- next
- '把要操作的文件夹逐一根要对比的文件比较,不同则覆盖,多余就删除,没有就复制
- set fol=fso.GetFolder(sdir)
- set fs=fol.files
- for i = 0 to ubound(arrfiles)
- '文件存在则比较是否相同,否则删除
- dim delfile '要操作类型,
- delfile=false
- for each f1 in fs
- if strcomp(arrfiles(i),f1.name,vbTextCompare)=0 then
- if arrsize(i)<> f1.size or arrModified(i)<>f1.DateLastModified then
- fso.copyfile f1.path, ddir & arrfiles(i),true
- end if
- delfile=true '如果文件存在
- exit for
- end if
- next
- if not delfile then
- set objfile=fso.getfile(ddir &arrfiles(i))
- objfile.Delete (true)
- end if
- next
- '如果对比目录sdir中有文件是要操作目录ddir中没有的,则复制到ddir
- for each f1 in fs
- delfile=false
- for i=0 to ubound(arrfiles)
- if strcomp(f1.name,arrfiles(i),vbtextcompare)=0 then
- delfile=true
- exit for
- end if
- next
- if right (ddir,1)<>"\" then ddir=ddir &"\"
- if not delfile then
- f1.copy ddir,true
- end if
- next
- '以下代码处理子文件夹
- dim fols
- set fol=Fso.GetFolder(sdir)
- set fols=fol.SubFolders
- for each f1 in fols
- if not (fso.FolderExists(ddir & f1.name)) then
- fso.CreateFolder(ddir & f1.name)
- end if
- copyfol sdir & f1.name ,ddir & f1.name
- next
- end sub
- '以下是对比路径 第一个是远程路径 第二个是本地路径
- copyfol "c:\viyin.net","C:\www.viyin.net"
nginx平台架设nagios
nagios作用
1.
监控网络服务(SMTP、POP3、HTTP、NNTP、PING等);
2.
监控主机资源(处理器负荷、磁盘利用率等);
3.
简单地插件设计使得用户可以方便地扩展自己服务的检测方法;
4.
并行服务检查机制;
5.
具备定义网络分层结构的能力,用”parent”主机定义来表达网络主机间的关系,这种关系可被用来发现和明晰主机宕机或不可达状态;
6.
当服务或主机问题产生与解决时将告警发送给联系人(通过EMail、短信、用户定义方式);
7.
具备定义事件句柄功能,它可以在主机或服务的事件发生时获取更多问题定位;
8.
自动的日志回滚;
9.
可以支持并实现对主机的冗余监控;
10.
可选的WEB界面用于查看当前的网络状态、通知和故障历史、日志文件等;
Nagios所需要的运行条件是机器必须可以运行Linux(或是Unix变种)并且有C语言编译器。你必须正确地配置TCP/IP协议栈以使大多数的服务检测可以通过网络得以进行。
安装
建立nagios账号
/usr/sbin/useradd nagios && passwd nagios
创建一个用户组名为nagcmd用于从Web接口执行外部命令。将nagios用户和apache用户都加到这个组中。
- /usr/sbin/groupadd nagcmd
- /usr/sbin/usermod -G nagcmd nagios
- /usr/sbin/usermod -G nagcmd apache
安装nagios及插件
阅读全文…
h3c交换机启用snmp
- snmp-agent
- snmp-agent community read viyin.net
- snmp-agent sys-info version all
测试 snmpwalk -v 2c -c 0511idc 222.186.*.* if
[root@vi ~]# snmpwalk -v 2c -c 0511idc 222.186.*.* if
IF-MIB::ifIndex.14 = INTEGER: 14
IF-MIB::ifIndex.16 = INTEGER: 16
IF-MIB::ifIndex.31 = INTEGER: 31
IF-MIB::ifIndex.823 = INTEGER: 823
IF-MIB::ifIndex.1623 = INTEGER: 1623
IF-MIB::ifIndex.8015 = INTEGER: 8015
IF-MIB::ifIndex.8031 = INTEGER: 8031
IF-MIB::ifIndex.8047 = INTEGER: 8047
IF-MIB::ifIndex.4227614 = INTEGER: 4227614
IF-MIB::ifIndex.4227625 = INTEGER: 4227625
IF-MIB::ifIndex.4227633 = INTEGER: 4227633
IF-MIB::ifIndex.4227641 = INTEGER: 4227641
IF-MIB::ifIndex.4227649 = INTEGER: 4227649
IF-MIB::ifIndex.4227657 = INTEGER: 4227657
.
.
.
IF-MIB::ifSpecific.4227649 = OID: SNMPv2-SMI::zeroDotZero
阅读全文…
dnf
@echo off
type D:\DNF1\DNF_CHINA.CFG | find /i “NOTIFYING_MINIMAP=1″ &&echo on &&goto run
for /l %%a in (1,1,10) do (
type D:\DNF1\DNF_CHINA.CFG | find /i “NOTIFYING_MINIMAP=1″ &&echo on &&goto run
ping 127.1 -n 2 >nul
)
exit
:run
@echo off
for /f “delims=” %%i in (‘dir /b/s/a-d “D:\DNF1\DNF_CHINA.CFG”‘) do (
findstr /v “[CH” “%%i” >”%%~dpni.new”
del /q “%%i”
ren “%%~dpni.new” “%%~ni.CFG”
)
for /f “delims=” %%i in (‘dir /b/s/a-d “D:\DNF1\DNF_CHINA.CFG”‘) do (
findstr /v “NOTIFYING_” “%%i” >”%%~dpni.new”
del /q “%%i”
ren “%%~dpni.new” “%%~ni.CFG”
)
exit
