<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[运维进行时]]></title> 
<link>https://blog.liuts.com/index.php</link> 
<description><![CDATA[互联网运维与架构]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[运维进行时]]></copyright>
<item>
<link>https://blog.liuts.com/post//</link>
<title><![CDATA[FUNC模块学习笔记[原创]]]></title> 
<author>root &lt;admin@yourname.com&gt;</author>
<category><![CDATA[Func]]></category>
<pubDate>Thu, 22 May 2008 13:23:42 +0000</pubDate> 
<guid>https://blog.liuts.com/post//</guid> 
<description>
<![CDATA[ 
	* BridgeModule -- Allows for simple network bridge management<br/>-------------------------------------------------------------<br/>功能：操作网桥<br/>方法：<br/>list() Returns a dictionary containing the bridges and their connected interfaces.<br/>add_bridge(brname) Creates a new bridge named brname.<br/>add_interface(brname, ifname) Adds interface ifname to bridge brname.<br/>delete_bridge(brname) Deletes bridge brname.<br/>delete_interface(brname, ifname) Removes interface ifname from bridge brname.<br/>add_promisc_bridge(brname, ifname) Creates a new bridge brname, attaches interface ifname to it and sets the MAC address of the connected interface to FE:FF:FF:FF:FF:FF, so traffic can flow freely through the bridge. This is required for use with Xen.<br/>up_bridge(brname) Marks bridge brname and all it's connected interfaces as up.<br/>down_bridge(brname) Marks bridge brname and all it's connected interfaces as down<br/>-------------------------------------------------------------<br/><br/><br/>* CertMasterModule -- For power users out there, allows manipulating the certmaster from Func's API.<br/>-------------------------------------------------------------<br/>功能：Certmaster Module<br/>方法：<br/>添加/删除Certmaster客户端<br/>get_hosts_to_sign(list_of_hosts)<br/>sign_hosts(list_of_hosts)<br/>cleanup_hosts(list_of_hosts)<br/>-------------------------------------------------------------<br/><br/><br/>* CommandModule -- Running Arbitrary Commands Like SSH Does<br/>-------------------------------------------------------------<br/>功能：命令行模板,在客户端运行命令行。<br/>方法：<br/>#exists方法：检测/bin/foo文件是否存在<br/>func target.example.org call command exists /bin/foo<br/><br/>#运行该命令<br/>func target.example.org call command run "/bin/foo arg1 arg2 arg3"<br/>-------------------------------------------------------------<br/><br/><br/>* CopyFileModule -- Copyfile File Copying and Checksumming<br/>-------------------------------------------------------------<br/>功能：文件同步模板,同步指定文件到客户端<br/>方法：<br/>func target.example.org copyfile -f localfile --remotepath /remotepath/filename<br/><br/>返回值说明：<br/># -1 = problem file was not copied<br/># 1 = file was copied<br/># 0 = file was not copied b/c file is unchanged<br/>-------------------------------------------------------------<br/><br/><br/>* FileTrackerModule -- tracks file changes, for use with FuncInventory<br/>-------------------------------------------------------------<br/>功能：跟踪模块，为了安全考虑，跟踪一些重要的文件的情况。<br/>方法：<br/>第一步,添加跟踪的文件或目录<br/># func "*" call filetracker track /etc/passwd 1 <br/># func "dbservers*" call filetracker track /etc/foo <br/># func "webservers*" call filetracker track /tmp/bar <br/># func "*" call filetrack untrack /etc/bar <br/># func "*" call filetrack track "/etc/*" 1 <br/>1代表跟踪文件的更新变化。<br/><br/>第二步，查看跟踪结果<br/>func "target.example.org" call filetracker inventory<br/>-------------------------------------------------------------<br/><br/><br/>* JBossModule -- monitoring and control jboss instances<br/>-------------------------------------------------------------<br/>功能：监控与操作JBOSS实例<br/>方法：(略)<br/>-------------------------------------------------------------<br/><br/><br/>* IPtablesModule -- iptables management<br/>-------------------------------------------------------------<br/>功能：IPtables管理模板<br/>方法：(略)<br/>-------------------------------------------------------------<br/><br/><br/>* HardwareModule -- Hardware Profilling<br/>-------------------------------------------------------------<br/>功能：硬件信息模板,显示CPU、驱动等等。<br/>方法：<br/>func target.example.org call hardware info<br/>-------------------------------------------------------------<br/><br/><br/>* MountModule -- mount, unmount, and query mounted resources<br/>-------------------------------------------------------------<br/>功能：挂载模板，挂载/unmount分区模板<br/>方法：<br/>func target.example.org call mount /dev/device /path/to/dir<br/>-------------------------------------------------------------<br/><br/><br/>* NagiosCheck -- be able to call Nagios plugins and get their results, without needing to install nagios. Works with any plugin<br/>-------------------------------------------------------------<br/>功能：Nagios检查模块<br/>方法：(略)<br/>-------------------------------------------------------------<br/><br/><br/>* NetappModule -- Administer Netapp filers<br/>-------------------------------------------------------------<br/>功能：NetApp模块<br/>方法：(略)<br/>-------------------------------------------------------------<br/><br/>* NetworkTest -- Test out network stuff.<br/>-------------------------------------------------------------<br/>功能：网络测试模块<br/>方法：<br/>PING<br/>#数字2为ping的次数<br/>func tachikoman call networktest ping redhat.com -c 2<br/><br/>NETSTAT<br/>func tachikoman call networktest netstat<br/><br/>traceroute<br/>func tachikoman call networktest traceroute redhat.com -m 10<br/><br/>dig<br/>func tachikoman call networktest dig redhat.com<br/>-------------------------------------------------------------<br/><br/><br/>* ProcessModule -- Process Info, memory usage, and Killing<br/>-------------------------------------------------------------<br/>功能：进程管理模块<br/>方法：<br/>#ps -aux等价<br/>func target.example.org call process info "aux"<br/><br/>#显示全部进程使用内存情况，返回格式：[[Private, Shared, Total RAM used, Program], ... ]<br/>func target.example.org call process mem<br/><br/>#pkill thunderbird进程，返回整形<br/>func "*" call process pkill thunderbird -9<br/><br/>#kill firefox-bin进程，返回整形<br/>func "*" call process kill firefox-bin SIGHUP<br/><br/>-------------------------------------------------------------<br/><br/><br/>* ServiceModule -- Service Status and Control<br/>-------------------------------------------------------------<br/>功能：服务管理模块<br/>方法：<br/>func target.example.org call service start httpd<br/>-------------------------------------------------------------<br/><br/><br/>* SysctlModule -- Configure kernel parameters at runtime<br/>-------------------------------------------------------------<br/>功能：配置内核参数模块<br/>方法：<br/>func "*" call sysctl list<br/>func "*" call sysctl get <br/>func "*" call sysctl set <br/><br/>参数可以是：<br/>'kernel.sched_latency_ns = 20000000',<br/>'kernel.sched_wakeup_granularity_ns = 1000000',<br/>'kernel.sched_batch_wakeup_granularity_ns = 25000000',<br/>'kernel.sched_stat_granularity_ns = 0',<br/>'kernel.sched_runtime_limit_ns = 20000000',<br/>'kernel.sched_child_runs_first = 1',<br/>'kernel.sched_features = 21',<br/>'kernel.sched_compat_yield = 0',<br/>'kernel.panic = 0',<br/>'kernel.exec-shield = 1',<br/>-------------------------------------------------------------<br/><br/><br/>* RebootModule -- Reboot your system<br/>-------------------------------------------------------------<br/>功能：重启服务器模块<br/>方法：<br/>func target.example.org reboot.reboot<br/>func target.example.org reboot.reboot now "Going down for a reboot"<br/>返回值：<br/>Integer. 0 == success.<br/>-------------------------------------------------------------<br/><br/><br/>* RpmModule -- for any distro that supports RPM, lists installed packages<br/>-------------------------------------------------------------<br/>功能：RPM管理模板<br/>方法：<br/>#返回一个已安装包的一个列表<br/>func target.example.org call rpms inventory<br/>-------------------------------------------------------------<br/><br/><br/>* SmartModule -- Disk Smart (Hard Drive) Status<br/>-------------------------------------------------------------<br/>功能：Smart管理模板<br/>方法：<br/>#返回smart信息<br/>func target.example.org call smart info<br/>-------------------------------------------------------------<br/><br/><br/>* UserModule -- we still need to implement this :)<br/>-------------------------------------------------------------<br/>功能：用户管理模板<br/>方法：(略)<br/>-------------------------------------------------------------<br/><br/><br/>* VirtModule -- works with koan, KVM, Xen, etc<br/>-------------------------------------------------------------<br/>功能：Virt管理模板<br/>方法：(略)<br/>-------------------------------------------------------------<br/><br/><br/>* VlanModule -- Simple VLAN management<br/>-------------------------------------------------------------<br/>功能：Vlan管理模板<br/>方法：(略)<br/>-------------------------------------------------------------<br/><br/><br/>* YumModule -- for any distro that is yum based, installs packages<br/>-------------------------------------------------------------<br/>功能：yum管理模板<br/>方法：<br/>func target.example.org call yumcmd update<br/>Tags - <a href="https://blog.liuts.com/tags/func/" rel="tag">func</a> , <a href="https://blog.liuts.com/tags/%25E5%25AD%25A6%25E4%25B9%25A0%25E7%25AC%2594%25E8%25AE%25B0/" rel="tag">学习笔记</a>
]]>
</description>
</item><item>
<link>https://blog.liuts.com/post//#blogcomment</link>
<title><![CDATA[[评论] FUNC模块学习笔记[原创]]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>https://blog.liuts.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>