{"id":24077517,"url":"https://github.com/ziutus/hmc_vios_aix","last_synced_at":"2025-04-30T09:52:21.686Z","repository":{"id":56876486,"uuid":"101467159","full_name":"ziutus/hmc_vios_aix","owner":"ziutus","description":"Ruby software to create reports about AIX Power environements (HMC, Power servers, VIOSes, NIM servers etc). Next version will allow also manage it. This API is unstable, stable version is expected in September 2020","archived":false,"fork":false,"pushed_at":"2022-01-28T03:42:57.000Z","size":595,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-17T17:42:13.567Z","etag":null,"topics":["aix","expect","hmc","ruby","vios"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ziutus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-26T06:20:40.000Z","updated_at":"2022-01-28T03:43:01.000Z","dependencies_parsed_at":"2022-08-20T11:30:56.319Z","dependency_job_id":null,"html_url":"https://github.com/ziutus/hmc_vios_aix","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziutus%2Fhmc_vios_aix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziutus%2Fhmc_vios_aix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziutus%2Fhmc_vios_aix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziutus%2Fhmc_vios_aix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ziutus","download_url":"https://codeload.github.com/ziutus/hmc_vios_aix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251680286,"owners_count":21626695,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aix","expect","hmc","ruby","vios"],"created_at":"2025-01-09T20:55:16.983Z","updated_at":"2025-04-30T09:52:21.664Z","avatar_url":"https://github.com/ziutus.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EOVS - End of Vendor Support ;)\nAs you maybe seen on the market, AIX is not so popular now.\nAs result, I'm not longer hire on posistion to use it so this project will not be continued in future.\nit is keep here to keep some really nice code (in my own opinion) but don't expect to any new stuff published here...\n\n# Motivation\n## Why this project?\nI'm the AIX SysAdmin and I don't like to do every day the same jobs. If something is repetitive, maybe we can write script for that?\nThis repository hold scripts which I wrote or rewrite from different projects / persons to have all in one place.\n\n## Why OOP (Object-oriented programming) for SA (System Administrators)?\nOOP is used in this project as I want to reuse code each time, where it is possible, \nit is not big difference in code when you want to use\noutput from \"lsmap -npiv\" to check if all virtual adapters are logged oryou want to compare with older output (for example between reboots during\nupgrade of system) or need commands to restore settings (after rebuild of system).\nOOP allow also refactoring: you can rebuild big part of code and \nwith TDD you are always sure that it works. So maintenance of code is much easier and faster.\n\n## Why  Test Driven Developing (TDD)?\nAIX systems are typically production systems so each time you change your scripts, you should be sure that it will not hurt your systems.\nTDD will help you to be sure that all classes, scripts etc. will behavior as you expect. TDD is also helping you to define what really you \nwant (as you are starting from writing tests ;). Other reason is simple, good tests are really good documentation of your code, it shows how\nto use classes and functions and what is expected to get as result. This documentation is always updated ;).\n\n## Why Ruby?\nI believe first scripts you were writing in bash/ksh but when project was growing you started to afraid to modify anything as \nyour changes could destroy others scripts. So you ended with big number of small scripts which maintenance took longer and longer. \nThen you started to write it in Perl and Object Oriented programming (OOP). Perl was always on AIX machines so you could\n run scripts on any of your systems. Problem is that OOP in Perl \nis difficult: no internal variables, no isolation etc, so it is time to change base language ;). \n\nWhy I choose Ruby and not Python or something different? Ruby is used in Chef :). Some part of code can be used in Chef.\n\n\n# Scripts\n## Collecting data \n### Script hmc_collect_data.sh\nThe hmc_collect_data.sh script is connecting to each HMC and taking needed data by calling command by command (check script).\nIn base directory (default: /var/opt/unix4you/) is created directory with timestamp and than for reach HMC\nis created subdirectory. It make life easier when you write Ruby reports (you just make one loop \nfor each HMC in directory on some day and time).\n```\n$ ./hmc_collect_data.sh -h\nSTDERR Usage of hmc_collect_data.sh\n        hmc_collect_data.sh [-h|--help] [-H|--hmcs HMC1[,HMC2[,HMC3...]]] [-f|--file FILE_LIST ] [-r|--report REPORT_TYPE] [-u|--user HMC_USER ]\n\n          -H|--hmcs HMC1[,HMC2[,HMC3...]]] - names of HMCs from which data should be collected\n          -f|--file FILENAME               - filename with list of HMCs from which data should be collected\n          -u|--user HMC_USER               - name of HMC_USER on which data should be collected (default: hscroot)\n          -r|--report REPORT_NAME          - name of report  for which data will be collected (default: ALL)\n          -h|--help                        - show this message\n          -d|--base-dir                    - base dir for all reports (default: /var/opt/unix4you/data/hmc)\n```\n\n\n## Usefull scripts\n### ping_all.rb\nThe ping_all.rb script is created to make fast check if many servers are up what is useful during network issues (switch down etc).\nNice option is to get list of servers from file and then choose only few of them by regexp.\n\n```\nziutus@server2 bin]$ ./ping_all.rb -h\nThis script ping in the same time many servers and provide result in nice way\n    -s, --server SERVER[,SERVER]     SERVER for test ping\n    -f, --filename FILENAME          FILENAME with list of servers to test\n    -e, --regexp REGEXP              regexp to take only some servers from list\n    -h, --help                       Display this screen\n\n```\n\n\n\n# Installation\n\n## gem\nI created gem, it is available on rubygems.org. It is called _hmc_vios_aix_.  You can add to your gem file:\n\n```\ngem \"hmc_vios_aix\"\n```\n\n\nif you want to use source code, you must add libraries to your path, you can use below code:\n\n```\nexport RUBYLIB=\"/home/ziutus/github/hmc_vios_aix-master/lib:/home/ziutus/ruby_local/lib\"\n```\n\nConfiguration file with default data for HMC script (hmc_manage.rb) should provide data like: hmc IP or name, user on HMC and password. It is yaml file. \nExample of config:\n\n```\n:hmc: 192.168.200.33\n:username: hscroot\n:password: TopSecretPasswordAbc1234\n```\n\n# API Reference\n## Lpar_profile class\n\nThe Lpar_profile class is created to analyze profile information for LPAR.\nYou can read profile output file collected by hmc_collect_data.sh, than\nanalyze it (by calling lssyscfgProfDecode) and than make what you need :)\n\n```\nstring_from_file = 'name=normal,lpar_name=nim1,lpar_id=5,lpar_env=aixlinux,all_resources=0,min_mem=2048,desired_mem=6144,max_mem=10240,min_num_huge_pages=0,desired_num_huge_pages=0,max_num_huge_pages=0,mem_mode=ded,hpt_ratio=1:64,proc_mode=shared,min_proc_units=0.1,desired_proc_units=0.3,max_proc_units=0.8,min_procs=1,desired_procs=1,max_procs=2,sharing_mode=cap,uncap_weight=0,io_slots=none,lpar_io_pool_ids=none,max_virtual_slots=10,\"virtual_serial_adapters=0/server/1/any//any/1,1/server/1/any//any/1\",\"virtual_scsi_adapters=2/client/2/vios1/2/1,3/client/3/vios2/2/1\",\"virtual_eth_adapters=6/1/6//0/0,7/0/7//0/0\",hca_adapters=none,boot_mode=norm,conn_monitoring=0,auto_start=0,power_ctrl_lpar_ids=none,work_group_id=none,redundant_err_path_reporting=0'\n\nprofile = Lpar_profile.new(5)\nprofile.lssyscfgProfDecode(string)\n```\n\nNow you can do what you want in your Ruby files, for example:\n* Ignore some profiles if name has have something in name\n\n``` \nnext if profile.name =~ /ignore/\n```\n* Ignore profile if it is VIOS\n``` \nnext if profile.lpar_env == 'vioserver'\n```\netc...\n\n# Tests\nIn this project we are using Unit Tests. All tests are in /t directory. if you want to run one test, just call:\n```\nruby hmc_lpar_profile.rb -n test_profile_decode_6\n```\n\n# Contributors\n\n# License\nGPL","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziutus%2Fhmc_vios_aix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fziutus%2Fhmc_vios_aix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziutus%2Fhmc_vios_aix/lists"}