ã»ãšãã©ã®è·å Žã¯ã6é建ãŠã®å»ºç©å ã«ãããŸãã ãªã¢ãŒããžã§ãããããŸãã å ¬åã¯ããŸããŸãªåŸæ¥å¡ã«ãã£ãŠç®¡çãããŠãããäžéšã®å Žæã¯ä»ã®çµç¹ã«å±ããITåŸæ¥å¡ããŸã£ããããªãå ŽåããããŸãã ç¹å¥ãªèšç·Žãåãã人ã ã®è²¬ä»»ç¯å²ã«ãããã°ããŒãã«ãããã¯ãŒã¯ãšã»ãã¥ãªãã£ã DHCPãDNSãADïŒååšããå ŽåïŒã¯ã©ãã«ããããŸããã ITIL / ITSMã¯ã€ã³ããŒããããæåã§ãã ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã WindowsXPãWindowsVistaãWindows7ã è·å Žã¯ãIPã¢ãã¬ã¹ã匷å¶çã«å€æŽããããšã§ã建ç©ã®ããŸããŸãªéšåã«ç§»åã§ããŸãã éåžžãã³ã³ãã¥ãŒã¿ãŒã§äœæ¥ãããŠãŒã¶ãŒã¯ç®¡çè æš©éãæã£ãŠãããããïŒ COMPUTERNAMEïŒ ãå«ããã¹ãŠãå€æŽã§ããŸãã åŸè ã®å€æŽãé²ãããšããå§ãããŸã å ±æããªã³ã¿ãŒã«äœ¿çšãããŸãã
ããŒã¹ã©ã€ã³ãšç®æš
ç£èŠã«ããããããžã§ã¯ãã®ç®æšã¯ãWebã¢ããªã±ãŒã·ã§ã³ã®å¯çšæ§ã®ç¢ºèªãjavaãšpostgresqlãšOSã®ã°ã©ãåã«ãããã©ã¡ãŒã¿ãŒã®åé€ãé倧ãªå Žåã®rssãsmsãé³å£°é話ã«ããéç¥ã§ãã
ãªãŒã±ã¹ãã¬ãŒã·ã§ã³ã®äž»ãªç®æšã¯ã500人以äžã®ãŠãŒã¶ãŒãšã®éä¿¡ãé€å€ããããšã§ãã ãã©ã¡ãŒã¿ããã°ããäžæ¬å€æŽãããœãããŠã§ã¢ããã±ãŒãžã蚌ææžãããã³ãGPOã®ãããªãœããããªã·ãŒããã€ã³ã¹ããŒã«ããæ©èœãåããŠããŸãã
å·ã®æŠç¥çåªå äºé ãèæ ®ããå®å šãªèŒžå ¥ä»£æ¿ã«çŠç¹ãåœãŠãææ¥ã®ã¯ãŒã¯ã¹ããŒã·ã§ã³ã¯ã¯ãŒã¯ãããŒãŠãŒã¶ãŒã«ããããMSVSferaãŸãã¯ROSAãæã£ãŠããå¯èœæ§ããããŸããæ§æ管çãšç£èŠããŒã«ã¯ããªãŒãã³ãœãŒã¹ã®ã¯ãã¹ãã©ãããã©ãŒã ãWebããŒã¹ã®ç®¡çã€ã³ã¿ãŒãã§ã€ã¹ãšå®è£ ãšææã®ã³ã¹ãããŒãã«ããæ¹ãè¯ãã§ãããã
ãã€ãããã¯DNS
IPã¢ãã¬ã¹ã¯æ¬¡ã®ã«ãŒã«ã«åŸã£ãŠç¶æãããŸãïŒ10.建ç©ããã£ãã³ã è·å Žã®å Žæãå€æŽãããšãIPã¢ãã¬ã¹ãå€æŽãããŸãã æåã§å€æŽãã DHCPã¯äœ¿çšã§ããªãããããªãã·ã§ã³82ã¯é©çšãããŸããã ã·ã¹ãã ãŠãããã®åšåº«æ°ã«éè€ãçºçããå ŽåããããŸãã æ¯èŒçäžå®ããŠããå¯äžã®ãã®ã¯MACã¢ãã¬ã¹ã§ãã ãã€ã³ãããŸãã è·å Žã®ååã®ãã³ãã¬ãŒããPC- {maksezdeliteli}ãšããŠå®çŸ©ããŸãã ã³ã³ãã¥ãŒã¿ãŒã«è€æ°ã®ãããã¯ãŒã¯æ¥ç¶ãããå Žåããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ãã€ã³ã¹ããŒã«ããçŽåŸã«ã€ãŒãµããããæåã«ãªããšæ³å®ããŸãã ïŒ COMPUTERNAMEïŒ ã®å®æ°ãšããŠãã®ã¢ãã¬ã¹ã䜿çšããŸãã
蚌ææžã䜿çšããã«ã¯ãFQDNïŒå®å šä¿®é£Ÿãã¡ã€ã³åïŒãå¿ èŠã§ãããŸããDNSããªãããšãæ¡ä»¶ããå¿ èŠã§ãã ãã®ç¶æ³ã§ã®äŸ¿å©ãªè§£æ±ºçã¯åçDNSã§ããïŒ COMPUTERNAMEïŒ ãIPã¢ãã¬ã¹ãšç §åããããã«å¿ããŠãŠãŒã¶ãŒãšå人çã«éä¿¡ããå¿ èŠãçããå Žåã«è·å Žã®çŸåšã®å Žæãå€æããã®ã«äŸ¿å©ã§ãã
ã¯ã©ã€ã¢ã³ããDNSãŸãŒã³ãåçã«æŽæ°ããæåã®ãœãªã¥ãŒã·ã§ã³ã¯ãWindowsã®ãã€ã³ãããã±ãŒãžã®NsupdateãŠãŒãã£ãªãã£ã§ãããããã®å Žåãã¯ã©ã€ã¢ã³ãã¯å ±éããŒãæã£ãŠããããããŸãŒã³å ã®ã¬ã³ãŒãã ãã§ãªãå€æŽã§ããŸãã ããå®å šãªãœãªã¥ãŒã·ã§ã³ã¯ãã¯ã©ã€ã¢ã³ããHTTPãªã¯ãšã¹ããéä¿¡ãããµãŒããŒããã®ã«ãŒã«ã«åŸã£ãŠå€æŽãè¡ãå Žåã§ãã ãã®ãªãã·ã§ã³ã§ãŸãŒã³ãä¿åããæ¹æ³ã¯æããã§ã-ããã¯SQLããŒã¿ããŒã¹ã§ãã ããã©ã«ãã§ã¯ãPowerDNSãµãŒããŒã¯ããŒã¿ããŒã¹ããã®ã¯ãšãªãåŠçããããã«æ§æãããŠããŸãã å€ãã®å€§èŠæš¡ãããžã§ã¯ãã§äœ¿çšãããŠãããéåžžã«å®å®ããŠããããã§ãã ããã䜿çšããŸãã
Ubuntuã«ã€ã³ã¹ããŒã«ããæ¹æ³
PowerDNSãã€ã³ã¹ããŒã«ããŸãã
$ sudo apt-get install -y pdns-server pdns-backend-mysql
PowerDNSã®ãã¹ãïŒ
PowerDNSãå®è¡ãããŠããããšã確èªããŸãã
$ sudo netstat -tap | grep pdns
çºè¡ããå¿ èŠããããŸãïŒ
roto @ saltïŒãïŒnetstat -tap | grep pdns
PowerDNSãå¿çããããšã確èªããŸãã
$ sudo dig 127 .0.0.1
çºè¡ããå¿ èŠããããŸãïŒ
roto @ saltïŒãïŒ127.0.0.1ãæã
$ sudo apt-get install -y pdns-server pdns-backend-mysql
PowerDNSã®ãã¹ãïŒ
PowerDNSãå®è¡ãããŠããããšã確èªããŸãã
$ sudo netstat -tap | grep pdns
çºè¡ããå¿ èŠããããŸãïŒ
roto @ saltïŒãïŒnetstat -tap | grep pdns
tcp 0 0 *:domain *:* LISTEN 891/pdns_server-ins
PowerDNSãå¿çããããšã確èªããŸãã
$ sudo dig 127 .0.0.1
çºè¡ããå¿ èŠããããŸãïŒ
roto @ saltïŒãïŒ127.0.0.1ãæã
; <<>> DiG 9.9.5-3ubuntu0.1-Ubuntu <<>> @127.0.0.1 ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21529 ;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1 ;; WARNING: recursion requested but not available ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 2800 ;; QUESTION SECTION: ;. IN NS ;; Query time: 1 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Fri Feb 13 11:29:05 KRAT 2015 ;; MSG SIZE rcvd: 239
å¿«é©ãªãŸãŒã³ç®¡çã®ããã«ãPowerDNSãžã®ããŸããŸãªã€ã³ã¿ãŒãã§ãŒã¹ãäœæãããŠããŸãã powerdns-webinterfaceãæ¿èªããŸãã
ããã¯ã©ã®ããã«èŠããŸãã
Ubuntuã«ã€ã³ã¹ããŒã«ããæ¹æ³
LAMPãšå¿
èŠãªã¢ãžã¥ãŒã«ãã€ã³ã¹ããŒã«ããŸãã
$ sudo apt-get install gettext
ããã«ã¹ã¯ãªããã®ããŠã³ããŒãïŒ
$ cd / tmp
$ wget powerdns-webinterface.googlecode.com/files/powerdns-webinterface-1.5.3.tar.gz
$ tar xvfz webinterface-1.5.3.tar.gz
$ sudo mv webinterface-1.5.3 / var / www / powerdns
äœæ¥ãã©ã«ããŒãžã®æžã蟌ã¿ãèš±å¯ããŸãã
$ sudo chown -R www-dataïŒwww-data / var / www / powerdns / tmp / templates_c
ããŒã¿ããŒã¹ãã€ã³ããŒãããŸãã
$ sudo mysql -uãŠãŒã¶ãŒå-p pdns db </ path-to / install.sql
Configs / db.phpã¯ãpdns dbããŒã¿ããŒã¹ã«æ¥ç¶ããããã®æ£ãã詳现ãæ£ãã
httpïŒ// <IP_or_name.our.server> / powerdnsãšãããŠãŒã¶ãŒå/ãã¹ã¯ãŒãadminïŒadminã§ãã©ãŠã¶ãŒã«ã¢ã¯ã»ã¹ãããã¹ã¯ãŒããå€æŽããŸãã
$ sudo apt-get install gettext
ããã«ã¹ã¯ãªããã®ããŠã³ããŒãïŒ
$ cd / tmp
$ wget powerdns-webinterface.googlecode.com/files/powerdns-webinterface-1.5.3.tar.gz
$ tar xvfz webinterface-1.5.3.tar.gz
$ sudo mv webinterface-1.5.3 / var / www / powerdns
äœæ¥ãã©ã«ããŒãžã®æžã蟌ã¿ãèš±å¯ããŸãã
$ sudo chown -R www-dataïŒwww-data / var / www / powerdns / tmp / templates_c
ããŒã¿ããŒã¹ãã€ã³ããŒãããŸãã
$ sudo mysql -uãŠãŒã¶ãŒå-p pdns db </ path-to / install.sql
Configs / db.phpã¯ãpdns dbããŒã¿ããŒã¹ã«æ¥ç¶ããããã®æ£ãã詳现ãæ£ãã
httpïŒ// <IP_or_name.our.server> / powerdnsãšãããŠãŒã¶ãŒå/ãã¹ã¯ãŒãadminïŒadminã§ãã©ãŠã¶ãŒã«ã¢ã¯ã»ã¹ãããã¹ã¯ãŒããå€æŽããŸãã
Windows PCãèªååããããã®æ§æ管çããŒã«
åœåãåšåº«ç®¡çã·ã¹ãã ã¯éäžãœãããŠã§ã¢é åžã®ããã«èæ ®ãããŠããŸããã ocsinventory-ngãšMandriva Pulseã®æ¢åã®å®èšŒæžã¿ãœãªã¥ãŒã·ã§ã³ã«ã¯ãæ©èœã«ããã±ãŒãžãã€ã³ã¹ããŒã«ããæ©èœããããŸãã ã©ã¡ãã«ããService DeskïŒç¹ã«GLPI ïŒãªã©ã®ITIL / ITSMèŠçŽ ãšäŸ¿å©ã«çµ±åããæ©èœãå«ãŸããŠããŸãããæ¬è³ªçã«ã¯çŸåšã®ç¶æ³ã§ã¯ãããŸããã Windowsã¬ãžã¹ããªã®ãã©ã¡ãŒã¿ãŒã®å€æŽãšèšŒææžã®å±éã¯ãã€ã³ã¹ããŒã«ããã±ãŒãžã®è£œé ãšããŠã®ã¿æ瀺ãããŸãã 管çè æš©éãæã€ãŠãŒã¶ãŒã¯ããããã®ããã±ãŒãžããã·ã³ããåé€ã§ããŸãã ããã«åºã¥ããŠãæ§æ管çã·ã¹ãã ã®æ€èšãéå§ããŸããã
Puppetã¯æãäžè¬çã§ãã å€ãã®ã¢ãžã¥ãŒã«ãšãŠãŒã¶ãŒã€ã³ã¿ãŒãã§ã€ã¹ããããŸãã ã¯ã©ã€ã¢ã³ãã®æ§æãã¡ã€ã«ïŒãããã§ã¹ãïŒã®å€æŽã¯ãã¯ã©ã€ã¢ã³ãã次åãã¹ããµãŒããŒã«ã¢ã¯ã»ã¹ãããšãã«ããŸãã¯ããã·ã¥æ©èœã䜿çšããŠãµãŒããŒããã®å³æå®è¡ã®èŠæ±ãéããŠãããããåãåããŸãã
Windowsã·ã¹ãã ãæäœããããã®ã¢ãžã¥ãŒã«ããããŸãã puppet-3.1.1.msiã®åŸã§WindowsXPã·ã¹ãã ã®ãµããŒããäžæ¢ãããçŸåšã®puppet-3.7.3.msiãéå§ã§ããŸããã§ããã ã·ã¹ãã é¢æ°ã®åŒã³åºãã«é¢é£ä»ããããŠããŸãã å€ãããŒãžã§ã³ã§ã¯ãã system32 ããªã©ã®ããã¡ã¯ããã¯ãªãããããã§ã¹ãã§ã¯ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã«å¿ããŠç°ãªãã·ããªãªãèšè¿°ããå¿ èŠããããŸãã ããã¯ãã¹ãŠã·ã¹ãã ã®äœ¿çšãè€éã«ããä»ã®ããŒã«ãæ¯æããŠæŸæ£ããããšã決å®ãããŸããã
SaltStackã¯ãããã·ã¥ã¡ãœããã䜿çšããŠã¯ã©ã€ã¢ã³ãïŒãããªã³ïŒãšéä¿¡ãããšããç¹ã§Puppetã«äŒŒãŠããŸãã Minionã¯ããŒããéããŸãããããµãŒããŒã«æ¥ç¶ãããµãŒããŒããã®ã³ãã³ããåŸ æ©ããããããµãŒãã¹ã®ã»ãã¥ãªãã£ãåäžããŸãã Puppetã«èšå®ãèšè¿°ããããã®ãããã§ã¹ããããå ŽåãSaltStackã¯ãç¶æ ãã®æŠå¿µãå°å ¥ããŸãã ãã¹ã¿ãŒã§è¡ãããå€æŽã¯ããã¹ãŠã®ãããªã³ã§å®è¡ãããŸãã ç¶æ ã®å®è¡ã¯ãŠã£ã¶ãŒãããéå§ãããPuppetã§å®è£ ãããã¯ã©ã€ã¢ã³ãèªäœã«ãã£ãŠéå§ãããããã§ã¯ãªãããšã«æ³šæããŠãã ããã ãããªã³ãé·æéã·ã£ããããŠã³ããå Žåã«çŸåšã®ç¶æ ãç¶æããããã«ãæ§æãã¡ã€ã«ã«ãã©ã¡ãŒã¿ãŒãè¿œå ãããŸããã
startup_statesïŒ 'highstate'ïŒCïŒ\ salt \ conf \ minionïŒ
ç¶æ ã¯ãæ¡åŒµåãslsã®YAML圢åŒã®æ§æãã¡ã€ã«ã§ãã
ããã¯ã©ã®ããã«èŠããŸãã
ç¹ã«æå®ããªãéããç¶æ ã®èªã¿åãã¯top.slsãã¡ã€ã«ã§å§ãŸããŸãã ç¹å®ã®ã°ã«ãŒãã®.slsãã¡ã€ã«ã®ãªã¹ããå«ãŸããŠããŸãã
roto@salt:/etc/salt/files# cat top.sls base: # '*': # Windows 'all_pc': - match: nodegroup - gr_inventory - gr_7z - gr_chrome - gr_libreoffice - gr_klitecodec - gr_essentials # 'gr_garant': - match: nodegroup - gr_garant # + 'gr_consultant': - match: nodegroup - gr_consultant
ã°ã«ãŒãã¯ãã¹ã¿ãŒæ§æãã¡ã€ã«ïŒ/ etc / salt / masterïŒã§å®çŸ©ãããŠãããéåžžã«æè»ã«æå®ã§ããŸãã 詳现ã«ã€ããŠã¯ããã¥ã¡ã³ãããèªã¿ãã ããã
ããã¥ã¡ã³ãã®äŸã§ã¯ãã°ã«ãŒãã¯å€æ°ã«ãã£ãŠå®çŸ©ãããŠããŸãã ããŒã¿ããŒã¹ãããŒã¯ã³ãããã·ã¥ã®åçã¿ã€ãã®ãã¹ã¯ãŒãã®å Žåããããã¯æ±ã§ãããéçãªç²åºŠã§ãã ããã«ãå€æ°ã¯ç¶æ ã®èª¬æãšãœã«ãã³ãã³ãã©ã€ã³ã§äœ¿çšã§ããŸãã
roto @ saltïŒ/ etc / salt / filesïŒsalt âG 'cpuarchïŒAMD64' test.ping
äŸãšããŠãMicrosoftã¢ã³ããŠã€ã«ã¹ã®ãã¹ããŒã¿ã¹ãããªã¹ãããŸãã
roto@salt:/etc/salt/files# cat gr_essentials.sls {% if grains['cpuarch'] == 'AMD64' %} w64_essentials: pkg: - installed {% elif grains['osrelease'] == '7' %} w32_essentials: pkg: - installed {% elif grains['osrelease'] == 'XP' %} w32xp_essentials: pkg: - installed {% endif %}
* Windows7以å€ã®å ¬åã«ã¯ä»ã®x64ã·ã¹ãã ã¯ãããŸãã
ãœãããŠã§ã¢ããã±ãŒãžã¯ããã¹ã¿ãŒæ§æãã¡ã€ã«ïŒ/ etc / salt / masterïŒã§æå®ããããªããžããªããã€ã³ã¹ããŒã«ãããŸãã init.slsãã¡ã€ã«å ã®ããã±ãŒãžã®èª¬æããã®ãªã¹ãïŒ
roto@salt:/etc/salt/files/win/repo/w32xp_essentials# cat init.sls w32xp_essentials: 4.4.304.0: installer: 'salt://win/repo/w32xp_essentials/mseinstall.exe' full_name: Microsoft Security Essentials locale: ru_RU reboot: False install_flags: '/q /s /runwgacheck ' uninstaller: '%ProgramFiles(x86)%\Microsoft Security Client\Setup.exe' uninstall_flags: ' /U /S'
Salt masterã«ã¯ãã¡ã€ã«ãµãŒããŒãçµã¿èŸŒãŸããŠãããä»»æã®ãã¡ã€ã«ãæå ã«æž¡ãããšãã§ããŸãã TCPããŒãïŒ
- 4505ïŒç®¡ççš
- 4506ïŒãã¡ã€ã«è»¢éçš
SaltStackã«ã¯ãSaltPadããã³Halite Webã€ã³ã¿ãŒãã§ã€ã¹ããããŸãã æåã®ãã®ã¯éå§ã§ããŸããã§ããã2çªç®ã®ãã®ã䜿çšãããšãã·ã¹ãã ã¡ãã»ãŒãžãã°ããããªã³ã®ã¹ããŒã¿ã¹ã衚瀺ãããããã«ã³ãã³ããéä¿¡ããããšãã§ããŸãã
ããã¯ã©ã®ããã«èŠããŸãã
ãã¹ãäžã圌ã¯ä»ã®ã·ã¹ãã ãç¹ã«Puppet-Dashboardã®ãŠãŒã¶ãŒã€ã³ã¿ãŒãã§ãŒã¹ãããèããå£ã£ãŠãããéåžžã«ä¿¡é Œæ§ãäœããäžå®å šãªãœãªã¥ãŒã·ã§ã³ã§ããããšã瀺ããŸããã
ããã¯ã©ã®ããã«èŠããŸãã
åé¡ãåé¿ããããã«ãSHELLINABOXãã€ã³ã¹ããŒã«ããŸããã
ããã¯ã©ã®ããã«èŠããŸãã
Ubuntuã«ã€ã³ã¹ããŒã«ããæ¹æ³
html5ãã©ãŠã¶ãŒãä»ããsshã¢ã¯ã»ã¹çšã®ããã¯ã¹ã«ã·ã§ã«ãã€ã³ã¹ããŒã«ããŸãã
$ sudo apt-get install openssl shellinabox
ããã©ã«ãèšå®ãç·šéããŸãã
$ sudo vi / etc / default / shellinabox
ãµãŒãã¹ãåèµ·åããŸãã
$ sudo service shellinabox restart
ããŒãã確èªããŠãã ããïŒ
$ sudo netstat -nap | grep shellinabox
httpsïŒ// <ãµãŒããŒã®IP_or_name>ãhtml 5äºæãã©ãŠã¶ãŒã§éããŸãã 䜿çšããŸãã
$ sudo apt-get install openssl shellinabox
ããã©ã«ãèšå®ãç·šéããŸãã
$ sudo vi / etc / default / shellinabox
# TCP shellinboxd' SHELLINABOX_PORT=443 # IP SSH SHELLINABOX_ARGS="--o-beep -s /:SSH:localhost --localhost-only"
ãµãŒãã¹ãåèµ·åããŸãã
$ sudo service shellinabox restart
ããŒãã確èªããŠãã ããïŒ
$ sudo netstat -nap | grep shellinabox
httpsïŒ// <ãµãŒããŒã®IP_or_name>ãhtml 5äºæãã©ãŠã¶ãŒã§éããŸãã 䜿çšããŸãã
æçµçãªã€ã³ã¹ããŒã«ã¹ã¯ãªããã¯æ¬¡ã®ãšããã§ãã
install.cmd
@Echo Off rem /************************************* rem * Install for SaltStack * rem *-----------------------------------* rem * (c) 2015 by Aleksey Ovchinnikov * rem * License: GPL * rem * Feel free to customize on your * rem * needs as long this copyright * rem * remains intact * rem *************************************/ SetLocal EnableExtensions rem /// , AT > NUL If %ERRORLEVEL% EQU 1 ( echo Please use "Run as Administrator"! pause exit /b ) rem /// mac %SYSTEMROOT%\System32\getmac.exe /NH /FO csv > %TEMP%\all_mac.tmp type %TEMP%\all_mac.tmp | findstr /r /c:"-" > %TEMP%\all_mac.txt del %TEMP%\all_mac.tmp for /f "usebackq delims=" %%i in (`find /n /v "" %TEMP%\all_mac.txt ^| find "[1]"`) do ( set mac=%%i ) For /f "delims=, tokens=1" %%i in ("%mac%") do ( set mac=%%i ) set mac=%mac:~4,17% For /f "delims=^- tokens=*" %%i in ("%mac%") do ( set mac=%%i ) set mac=%mac:-=% set mac=%mac:~0,12% rem /// If not "%ComputerName%"=="PC-%mac%" ( rem wmic.exe /interactive:off ComputerSystem Where "name = '%computername%'" call rename Name='PC-%mac%' rem wmic os where Primary='TRUE' reboot REG ADD HKLM\SYSTEM\ControlSet001\Control\ComputerName\ComputerName /v ComputerName /t REG_SZ /d "PC-%mac%" /f REG ADD HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName /v ComputerName /t REG_SZ /d "PC-%mac%" /f REG ADD HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters /v "NV Hostname" /t REG_SZ /d "PC-%mac%" /f REG ADD HKLM\SYSTEM\ControlSet001\Services\Tcpip\Parameters /v "NV Hostname" /t REG_SZ /d "PC-%mac%" /f shutdown -t 0 -r -f exit /b ) echo ...get NAME ^> %ComputerName% rem /// IP FOR /F "usebackq tokens=2 delims=[]" %%i IN (`ping %Computername% -n 1 -4`) DO if not "%%i"=="" Set ip=%%i echo ...get IP ^> %ip% rem /// set key=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion For /F "delims=" %%a in ('reg query "%key%" /v "ProductName" ^| find /i "ProductName"') do ( set OSName=%%a ) set OSName=%OSName:ProductName=% set OSName=%OSName:REG_SZ=% For /F "tokens=* delims= " %%a in ("%OSName%") do ( set OSName=%%a ) echo ...get OS ^> %OSName% rem /// Set xOS=x64 If "%PROCESSOR_ARCHITECTURE%"=="x86" If Not Defined PROCESSOR_ARCHITEW6432 Set xOS=x86 echo ...get TYPE ^> %xOS% rem /// DNS set data=%ip%:%COMPUTERNAME%:%COMPUTERNAME%_%OSName%_%xOS% set data=%data: =_% echo ...add DNS ^> c:\saltstack\curl.exe -s http://salt../dns/update.php?data=%data%" rem /// SaltStack Windows If %xOS%==x86 (c:\saltstack\Salt-Minion-3.1.5-win32-Setup.exe /S /master=salt.. /minion-name=%COMPUTERNAME%) Else (c:\saltstack\Salt-Minion-3.1.5-AMD64-Setup.exe /S /master=salt.. /minion-name=%COMPUTERNAME%) rem /// echo.startup_states: 'highstate' >>"C:\salt\conf\minion" echo ...auto state ^> Done! attrib +H +S c:\salt echo ...hide folder ^> Done! cd c:\ rmdir /s /qc:\saltstack
Zabbixç£èŠã·ã¹ãã
å€ãã®ç£èŠã·ã¹ãã ããããŸãã ç§ã¯é·ãéZabbixã«ç²ŸéããŠããããããéžæããŸããã
ããã¯ã©ã®ããã«èŠããŸãã
Ubuntuã«ã€ã³ã¹ããŒã«ããæ¹æ³
å¿
èŠãªããã±ãŒãžãã€ã³ã¹ããŒã«ããŸãã
$ sudo apt-get install zabbix-server-mysql zabbix-frontend-php ca-certificates-java libslf4j-java jarwrapper libandroid-json-org-java liblogback-java
ãµãŒããŒæ§æãã¡ã€ã«/etc/zabbix/zabbix_server.conf㧠ãããŒã¿ããŒã¹ãžã®æ¥ç¶ãæ§æããŸãã
$ sudo mcedit /etc/zabbix/zabbix_server.conf
ããŒã¿ããŒã¹ã®æºåïŒ
mysql âuuser-name âp
mysql>ããŒã¿ããŒã¹zabbixæåã»ããutf8 collatââe utf8_unicode_ciãäœæããŸãã
mysql>ã¯zabbixã®ãã¹ãŠã®ç¹æš©ãä»äžããŸã*ãzabbixãã§èå¥ãããzabbix @ localhostã«
mysql> exit;
æ§é ãšå€ãããŒã¿ããŒã¹ã«ããŒãããŸãã
$ sudo cd / usr / share / zabbix-server-mysql
$ sudo gunzip * .gz
$ sudo mysql -uuser-name zabbix -p <schema.sql
$ sudo mysql -uuser-name zabbix -p <images.sql
$ sudo mysql -uuser-name zabbix -p <data.sql
zabbixãåèµ·åããŸãã
$ sudo service zabbix-server star t
ãããŠããã¹ãŠã«ãšã©ãŒããªãããšã確èªããŸãã
$ tail -n 100 /var/log/zabbix-server/zabbix_server.log
å¿ èŠãªãã¡ã€ã«ãã³ããŒããŸãã
$ sudo cp /usr/share/doc/zabbix-frontend-php/examples/apache.conf /etc/apache2/conf-available/zabbix.conf
Webã€ã³ã¿ãŒãã§ãŒã¹ã®phpãã©ã¡ãŒã¿ãŒãã»ããã¢ããããŸãã
$ sudo mcedit /etc/apache2/conf-available/zabbix.conf
zabbix Webã€ã³ã¿ãŒãã§ãŒã¹èšå®ãã¡ã€ã«ãApacheã«è¿œå ããŸãã
$ sudo a2enconf zabbix.conf
ãããŠãWebãµãŒããŒãåèµ·åããŸãã
$ sudo service apache2 reload
WebãµãŒããŒ/ zabbixã®URLãéãããã¹ãŠã®æé ã«åŸããŸãã
æåŸã®ã¹ãããã§ã¯ã次ã®å ¥åãæ±ããããŸãã
ããã©ã«ãã®ãã°ã€ã³/ãã¹ã¯ãŒãïŒAdmin / zabbixã ãã°ã€ã³åŸã«ãã¹ã¯ãŒããå€æŽããŸãã
$ sudo apt-get install zabbix-server-mysql zabbix-frontend-php ca-certificates-java libslf4j-java jarwrapper libandroid-json-org-java liblogback-java
ãµãŒããŒæ§æãã¡ã€ã«/etc/zabbix/zabbix_server.conf㧠ãããŒã¿ããŒã¹ãžã®æ¥ç¶ãæ§æããŸãã
$ sudo mcedit /etc/zabbix/zabbix_server.conf
### Option: DBHost # Database host name. # If set to localhost, socket is used for MySQL. # If set to empty string, socket is used for PostgreSQL. # # Mandatory: no # Default: # DBHost=localhost ### Option: DBName # Database name. # For SQLite3 path to database file must be provided. DBUser and DBPassword are ignored. # Sample SQLite3 DBName: # DBName=/var/lib/zabbix/zabbix.sqlite3 # # Mandatory: yes # Default: # DBName= DBName=zabbix ### Option: DBUser # Database user. Ignored for SQLite. # # Mandatory: no # Default: # DBUser= DBUser=zabbix ### Option: DBPassword # Database password. Ignored for SQLite. # Comment this line if no password is used. # # Mandatory: no # Default: # DBPassword= DBPassword=zabbix
ããŒã¿ããŒã¹ã®æºåïŒ
mysql âuuser-name âp
mysql>ããŒã¿ããŒã¹zabbixæåã»ããutf8 collatââe utf8_unicode_ciãäœæããŸãã
mysql>ã¯zabbixã®ãã¹ãŠã®ç¹æš©ãä»äžããŸã*ãzabbixãã§èå¥ãããzabbix @ localhostã«
mysql> exit;
æ§é ãšå€ãããŒã¿ããŒã¹ã«ããŒãããŸãã
$ sudo cd / usr / share / zabbix-server-mysql
$ sudo gunzip * .gz
$ sudo mysql -uuser-name zabbix -p <schema.sql
$ sudo mysql -uuser-name zabbix -p <images.sql
$ sudo mysql -uuser-name zabbix -p <data.sql
zabbixãåèµ·åããŸãã
$ sudo service zabbix-server star t
ãããŠããã¹ãŠã«ãšã©ãŒããªãããšã確èªããŸãã
$ tail -n 100 /var/log/zabbix-server/zabbix_server.log
å¿ èŠãªãã¡ã€ã«ãã³ããŒããŸãã
$ sudo cp /usr/share/doc/zabbix-frontend-php/examples/apache.conf /etc/apache2/conf-available/zabbix.conf
Webã€ã³ã¿ãŒãã§ãŒã¹ã®phpãã©ã¡ãŒã¿ãŒãã»ããã¢ããããŸãã
$ sudo mcedit /etc/apache2/conf-available/zabbix.conf
php_value max_execution_time 300 php_value memory_limit 128M php_value post_max_size 16M php_value upload_max_filesize 2M php_value max_input_time 300 php_value date.timezone Asia/Krasnoyarsk
zabbix Webã€ã³ã¿ãŒãã§ãŒã¹èšå®ãã¡ã€ã«ãApacheã«è¿œå ããŸãã
$ sudo a2enconf zabbix.conf
ãããŠãWebãµãŒããŒãåèµ·åããŸãã
$ sudo service apache2 reload
WebãµãŒããŒ/ zabbixã®URLãéãããã¹ãŠã®æé ã«åŸããŸãã
æåŸã®ã¹ãããã§ã¯ã次ã®å ¥åãæ±ããããŸãã
ããã©ã«ãã®ãã°ã€ã³/ãã¹ã¯ãŒãïŒAdmin / zabbixã ãã°ã€ã³åŸã«ãã¹ã¯ãŒããå€æŽããŸãã
JMXã¢ãã¿ãªã³ã°
ããŒãžã§ã³2.0ãããzabbixã¯JMXãç£èŠããããã®ãã€ãã£ããµããŒããè¿œå ããŸããã çžäºäœçšã¯ãZabbix Javaã²ãŒããŠã§ã€ãšåŒã°ããããŒã¢ã³ãä»ããJMXã¢ããªã±ãŒã·ã§ã³ç®¡çAPIãä»ããŠçºçããŸãã Javaã§æžãããŠããŸãã
Ubuntuã«ã€ã³ã¹ããŒã«ããæ¹æ³
å¿
èŠãªããã±ãŒãžãã€ã³ã¹ããŒã«ããŸãã
$ sudo apt-get install --no-install-recommends zabbix-java-gateway
ãµãŒããŒæ§æãã¡ã€ã«/etc/zabbix/zabbix_java_gateway.confã§ãJavaã²ãŒããŠã§ã€ã®æ¥ç¶ãšèµ·åãªãã·ã§ã³ãæ§æããŸãã
$ sudo mcedit /etc/zabbix/zabbix_java_gateway.conf
ãµãŒããŒæ§æãã¡ã€ã«/etc/zabbix/zabbix_server.confã§ãJavaã²ãŒããŠã§ã€ãžã®æ¥ç¶ãæ§æããŸãã
$ sudo mcedit /etc/zabbix/zabbix_server.conf
èµ·åãèš±å¯ããïŒ
$ sudo mcedit / etc / default / zabbix-server
ãµãŒãã¹ãéå§ããŸãã
$ sudoãµãŒãã¹zabbix-java-gateway restart
次ã®èšå®ã¯ãç£èŠãå®è¡ããããã·ã³ã§è¡ãããŸãã ã¢ããªã±ãŒã·ã§ã³ãµãŒããŒã®èµ·åã¹ã¯ãªãããŸãã¯ãµãŒãã¬ããã³ã³ããã«è¿œå ããŸãïŒ
zabbixãµãŒããŒãšãã¡ã€ã¢ãŠã©ãŒã«ã䜿çšãã管çè ãã·ã³ã®IPã¢ãã¬ã¹ãé€ãå šå¡ãžã®ãã®ããŒããžã®ã¢ã¯ã»ã¹ãéããŸãã
管çãã·ã³ããjdkããJConsoleãèµ·åããç£èŠãå®è¡ããããã·ã³ã«æ¥ç¶ããŸãã
æ¥ç¶ãæåããå Žåãzabbix Webã€ã³ã¿ãŒãã§ã€ã¹ã«ç§»åããç£èŠçšã®ãã©ã¡ãŒã¿ãèšå®ããå¿ èŠããããŸãã [èšå®]> [ãã¹ã]ã«ç§»åãã[ãã¹ãã®äœæ]ãã¯ãªãã¯ããŠãå¿ èŠãªå€ãå ¥åããŸãã
ãã°ãããããšãããŒã¿ã衚瀺ãããã°ã©ããäœæã§ããŸãã
$ sudo apt-get install --no-install-recommends zabbix-java-gateway
ãµãŒããŒæ§æãã¡ã€ã«/etc/zabbix/zabbix_java_gateway.confã§ãJavaã²ãŒããŠã§ã€ã®æ¥ç¶ãšèµ·åãªãã·ã§ã³ãæ§æããŸãã
$ sudo mcedit /etc/zabbix/zabbix_java_gateway.conf
# Java-gateway JavaGateway=127.0.0.1 # Java Gateway JavaGatewayPort=10052 # Java Gateway , StartJavaPollers=5
ãµãŒããŒæ§æãã¡ã€ã«/etc/zabbix/zabbix_server.confã§ãJavaã²ãŒããŠã§ã€ãžã®æ¥ç¶ãæ§æããŸãã
$ sudo mcedit /etc/zabbix/zabbix_server.conf
### Option: JavaGateway #<----->IP address (or hostname) of Zabbix Java gateway. #<----->Only required if Java pollers are started. # # Mandatory: no # Default: # JavaGateway= JavaGateway=127.0.0.1 ### Option: JavaGatewayPort #<----->Port that Zabbix Java gateway listens on. # # Mandatory: no # Range: 1024-32767 # Default: # JavaGatewayPort=10052 JavaGatewayPort=10052 ### Option: StartJavaPollers #<----->Number of pre-forked instances of Java pollers. # # Mandatory: no # Range: 0-1000 # Default: # StartJavaPollers=0 StartJavaPollers=5
èµ·åãèš±å¯ããïŒ
$ sudo mcedit / etc / default / zabbix-server
START=yes
ãµãŒãã¹ãéå§ããŸãã
$ sudoãµãŒãã¹zabbix-java-gateway restart
次ã®èšå®ã¯ãç£èŠãå®è¡ããããã·ã³ã§è¡ãããŸãã ã¢ããªã±ãŒã·ã§ã³ãµãŒããŒã®èµ·åã¹ã¯ãªãããŸãã¯ãµãŒãã¬ããã³ã³ããã«è¿œå ããŸãïŒ
-Djava.rmi.server.hostname=192.168.3.14 \ -Dcom.sun.management.jmxremote \ -Dcom.sun.management.jmxremote.port=12345 \ -Dcom.sun.management.jmxremote.authenticate=false \ -Dcom.sun.management.jmxremote.ssl=false \
zabbixãµãŒããŒãšãã¡ã€ã¢ãŠã©ãŒã«ã䜿çšãã管çè ãã·ã³ã®IPã¢ãã¬ã¹ãé€ãå šå¡ãžã®ãã®ããŒããžã®ã¢ã¯ã»ã¹ãéããŸãã
管çãã·ã³ããjdkããJConsoleãèµ·åããç£èŠãå®è¡ããããã·ã³ã«æ¥ç¶ããŸãã
ããã¯ã©ã®ããã«èŠããŸãã
æ¥ç¶ãæåããå Žåãzabbix Webã€ã³ã¿ãŒãã§ã€ã¹ã«ç§»åããç£èŠçšã®ãã©ã¡ãŒã¿ãèšå®ããå¿ èŠããããŸãã [èšå®]> [ãã¹ã]ã«ç§»åãã[ãã¹ãã®äœæ]ãã¯ãªãã¯ããŠãå¿ èŠãªå€ãå ¥åããŸãã
ããã¯ã©ã®ããã«èŠããŸãã
ãã°ãããããšãããŒã¿ã衚瀺ãããã°ã©ããäœæã§ããŸãã
ããã¯ã©ã®ããã«èŠããŸãã
PostgreSQLã¢ãã¿ãªã³ã°
PostgreSQL wikiã«ãããšãå€ãã®ç£èŠãœãªã¥ãŒã·ã§ã³ãäœæãããŠããŸãã libzbxpgsql ïŒLib-Zabbix-PostgreSQLïŒã«æ±ºããŸãã ã ããã¯ããµãŒããŒçšã®zabbixãšãŒãžã§ã³ãããã³xmlãã³ãã¬ãŒãçšã«Cã§èšè¿°ãããæåã«ã³ã³ãã€ã«ãããã¢ãžã¥ãŒã«ã§ãã ã¹ã¯ãªããã«å¯Ÿããå©ç¹ã¯ãæããã«1ã€ã®ããã»ã¹ã§ãããå€éšã®äŸåé¢ä¿ããªãããšã§ãã
Ubuntuã«ã€ã³ã¹ããŒã«ããæ¹æ³
ã¢ãžã¥ãŒã«ãèªåã§ã³ã³ãã€ã«ããããšããå§ãããŸãããã€ããªããã±ãŒãžã¯rpmã®ã¿ã§ãã åã£ãŠ
ç£èŠããããŒã¿ããŒã¹ã®ãããã·ã³ã«å¿ èŠãªããã±ãŒãžãã€ã³ã¹ããŒã«ããŸãã
$ sudo apt-get installãšã€ãªã¢ã³zabbix-agent
ã¢ãžã¥ãŒã«ãããŠã³ããŒãããŸãã
$ sudo wget downloads.sourceforge.net/project/libzbxpgsl/rpms/libzbxpgsql-0.1.1-1.el7.centos.x86_64.rpm
ããã±ãŒãžãdebã«å€æããŸãã
$ sudo alien libzbxpgsql-0.1.1-1.el7.centos.x86_64.rpm
ããã±ãŒãžãã€ã³ã¹ããŒã«ããŸãã
$ sudo dpkg -i libzbxpgsql_0.1.1-2_amd64.deb
ãšãŒãžã§ã³ãæ§æãã¡ã€ã«/etc/zabbix/zabbix_agentd.confã§ããµãŒããŒæ¥ç¶ãšãªãã·ã§ã³ãæ§æããŸãã
$ sudo mcedit /etc/zabbix/zabbix_agentd.conf
ãããŠããšãŒãžã§ã³ããåèµ·åããŸãã
$ sudo service zabbix-agent restart
template_postgresql_server.xmlãä¿åããŸã
zabbixãŠã§ãã€ã³ã¿ãŒãã§ãŒã¹ãéããèšå®>ãã³ãã¬ãŒãã«é²ã¿ãèšå®ã®ã€ã³ããŒããã¯ãªãã¯ããŸãã xmlãã¡ã€ã«ãã€ã³ããŒãããŸãã
ãã®ãã¹ãã®èšå®ãæ§æããŸãã å¿ èŠãªãã³ãã¬ãŒããšãã³ãã¬ãŒãPostgreSQLãµãŒããŒãè¿œå ããŸãã [ãã¯ã]ã¿ãã§ãç£èŠããããŒã¿ããŒã¹ã«æ¥ç¶ããããã®ãã©ã¡ãŒã¿ãŒãå ¥åããŸãã
ãã°ãããããšãããŒã¿ã衚瀺ãããã°ã©ããäœæã§ããŸãã
ç£èŠããããŒã¿ããŒã¹ã®ãããã·ã³ã«å¿ èŠãªããã±ãŒãžãã€ã³ã¹ããŒã«ããŸãã
$ sudo apt-get installãšã€ãªã¢ã³zabbix-agent
ã¢ãžã¥ãŒã«ãããŠã³ããŒãããŸãã
$ sudo wget downloads.sourceforge.net/project/libzbxpgsl/rpms/libzbxpgsql-0.1.1-1.el7.centos.x86_64.rpm
ããã±ãŒãžãdebã«å€æããŸãã
$ sudo alien libzbxpgsql-0.1.1-1.el7.centos.x86_64.rpm
ããã±ãŒãžãã€ã³ã¹ããŒã«ããŸãã
$ sudo dpkg -i libzbxpgsql_0.1.1-2_amd64.deb
ãšãŒãžã§ã³ãæ§æãã¡ã€ã«/etc/zabbix/zabbix_agentd.confã§ããµãŒããŒæ¥ç¶ãšãªãã·ã§ã³ãæ§æããŸãã
$ sudo mcedit /etc/zabbix/zabbix_agentd.conf
Server= ServerActive=: Hostname=doc..
ãããŠããšãŒãžã§ã³ããåèµ·åããŸãã
$ sudo service zabbix-agent restart
template_postgresql_server.xmlãä¿åããŸã
zabbixãŠã§ãã€ã³ã¿ãŒãã§ãŒã¹ãéããèšå®>ãã³ãã¬ãŒãã«é²ã¿ãèšå®ã®ã€ã³ããŒããã¯ãªãã¯ããŸãã xmlãã¡ã€ã«ãã€ã³ããŒãããŸãã
ãã®ãã¹ãã®èšå®ãæ§æããŸãã å¿ èŠãªãã³ãã¬ãŒããšãã³ãã¬ãŒãPostgreSQLãµãŒããŒãè¿œå ããŸãã [ãã¯ã]ã¿ãã§ãç£èŠããããŒã¿ããŒã¹ã«æ¥ç¶ããããã®ãã©ã¡ãŒã¿ãŒãå ¥åããŸãã
ããã¯ã©ã®ããã«èŠããŸãã
ãã°ãããããšãããŒã¿ã衚瀺ãããã°ã©ããäœæã§ããŸãã
ããã¯ã©ã®ããã«èŠããŸãã
ãã®èšäºã¯ãç§ã®çŸåšã®éçšäž»ã®ããã¥ã¡ã³ããšããŠæžãããŠããŸãã ã³ã¡ã³ããã³ã¡ã³ããäžæ£ç¢ºãã¯æè¿ããŸãã