通过OBD创建用户时输出2个[WARN] ,是会自动创建其他目录么?
[root@localhost opt]# obd host user init -u admin --host=192.168.40.110 -p admin
Connecting to the server
Please input username with sudo privileges. (default: root): root
Please input root password:
Create user admin
Set admins password Configure passwordless sudo for admin Enable password login Modify ulimit parameters 192.168.40.110: ( open files,max user processes,core file size,stack size... ) have been successfully modified! [WARN] can
t find dir /data/1
[WARN] cant find dir /data/log1 Trace ID: c6f6ba34-8c7f-11f0-8f14-000c29e13c26 If you want to view detailed obd logs, please run: obd display-trace c6f6ba34-8c7f-11f0-8f14-000c29e13c26 [root@localhost opt]# obd display-trace c6f6ba34-8c7f-11f0-8f14-000c29e13c26 [2025-09-08 14:48:07.528] [DEBUG] - cmd: [] [2025-09-08 14:48:07.529] [DEBUG] - opts: {'username': 'admin', 'password': '******', 'host': '192.168.40.110'} [2025-09-08 14:48:07.529] [DEBUG] - mkdir /root/.obd/lock/ [2025-09-08 14:48:07.529] [DEBUG] - unknown lock mode [2025-09-08 14:48:07.529] [DEBUG] - try to get share lock /root/.obd/lock/global [2025-09-08 14:48:07.530] [DEBUG] - share lock
/root/.obd/lock/global, count 1 [2025-09-08 14:48:07.530] [DEBUG] - mkdir /root/.obd/repository [2025-09-08 14:48:07.530] [DEBUG] - Searching init_user template for components ... [2025-09-08 14:48:07.530] [DEBUG] - mkdir /root/.obd/workflows [2025-09-08 14:48:07.531] [DEBUG] - Call workflow host_tool-py_script_workflow_init_user-1.0 for host_tool-1.0--None [2025-09-08 14:48:07.531] [DEBUG] - mkdir /root/.obd/mirror [2025-09-08 14:48:07.531] [DEBUG] - mkdir /root/.obd/mirror/remote [2025-09-08 14:48:07.531] [DEBUG] - mkdir /root/.obd/mirror/local [2025-09-08 14:48:07.531] [DEBUG] - mkdir /root/.obd/plugins [2025-09-08 14:48:07.531] [DEBUG] - mkdir /root/.obd/cluster/ [2025-09-08 14:48:07.532] [DEBUG] - mkdir /root/.obd/config_parser/ [2025-09-08 14:48:07.532] [DEBUG] - mkdir /root/.obd/optimize/ [2025-09-08 14:48:07.532] [DEBUG] - mkdir /root/.obd/tool/ [2025-09-08 14:48:07.532] [DEBUG] - import init_user [2025-09-08 14:48:07.532] [DEBUG] - add init_user ref count to 1 [2025-09-08 14:48:07.532] [DEBUG] - sub init_user ref count to 0 [2025-09-08 14:48:07.532] [DEBUG] - export init_user [2025-09-08 14:48:07.533] [DEBUG] - plugin host_tool-py_script_workflow_init_user-1.0 result: True [2025-09-08 14:48:07.533] [DEBUG] - Found for host_tool-py_script_workflow_init_user-1.0 for host_tool-1.0 [2025-09-08 14:48:07.533] [DEBUG] - Searching get_client plugin for components ... [2025-09-08 14:48:07.533] [DEBUG] - Searching get_client plugin for host_tool-1.0--None [2025-09-08 14:48:07.533] [DEBUG] - Found for host_tool-py_script_get_client-1.0 for host_tool-1.0 [2025-09-08 14:48:07.533] [DEBUG] - Call plugin host_tool-py_script_get_client-1.0 for host_tool-1.0--None [2025-09-08 14:48:07.533] [DEBUG] - import get_client [2025-09-08 14:48:07.534] [DEBUG] - add get_client ref count to 1 [2025-09-08 14:48:07.534] [INFO] Connecting to the server [2025-09-08 14:48:07.537] [DEBUG] -- host: 192.168.40.110, port: 22, user: admin, password: ****** [2025-09-08 14:48:09.512] [ERROR] Traceback (most recent call last): [2025-09-08 14:48:09.512] [ERROR] File "core.py", line 6202, in host_user_init [2025-09-08 14:48:09.512] [ERROR] File "core.py", line 256, in run_workflow [2025-09-08 14:48:09.513] [ERROR] File "core.py", line 298, in run_plugin_template [2025-09-08 14:48:09.513] [ERROR] File "core.py", line 347, in call_plugin [2025-09-08 14:48:09.513] [ERROR] File "_plugin.py", line 348, in __call__ [2025-09-08 14:48:09.513] [ERROR] File "_plugin.py", line 304, in _new_func [2025-09-08 14:48:09.513] [ERROR] File "/root/.obd/plugins/host_tool/1.0/get_client.py", line 54, in get_client [2025-09-08 14:48:09.513] [ERROR] client = sshclient(ip, username, password, stdio) [2025-09-08 14:48:09.513] [ERROR] File "/root/.obd/plugins/host_tool/1.0/get_client.py", line 34, in sshclient [2025-09-08 14:48:09.513] [ERROR] if not client.connect(stdio_func='verbose'): [2025-09-08 14:48:09.513] [ERROR] File "_stdio.py", line 1164, in func_wrapper [2025-09-08 14:48:09.513] [ERROR] File "ssh.py", line 460, in connect [2025-09-08 14:48:09.513] [ERROR] File "_stdio.py", line 1164, in func_wrapper [2025-09-08 14:48:09.513] [ERROR] File "ssh.py", line 411, in _login [2025-09-08 14:48:09.513] [ERROR] File "paramiko/client.py", line 485, in connect [2025-09-08 14:48:09.513] [ERROR] File "paramiko/client.py", line 818, in _auth [2025-09-08 14:48:09.513] [ERROR] File "paramiko/client.py", line 805, in _auth [2025-09-08 14:48:09.513] [ERROR] File "paramiko/transport.py", line 1638, in auth_password [2025-09-08 14:48:09.513] [ERROR] File "paramiko/auth_handler.py", line 263, in wait_for_response [2025-09-08 14:48:09.513] [ERROR] paramiko.ssh_exception.AuthenticationException: Authentication failed. [2025-09-08 14:48:09.513] [ERROR] [2025-09-08 14:48:09.513] [DEBUG] -- OBD-1013: admin@192.168.40.110 connect failed: username or password error [2025-09-08 14:48:09.513] [INFO] Please input username with sudo privileges. (default: root): [2025-09-08 14:48:15.774] [DEBUG] -- root@192.168.40.110 execute: echo ****** | sudo -S whoami [2025-09-08 14:48:15.775] [DEBUG] -- host: 192.168.40.110, port: 22, user: root, password: ****** [2025-09-08 14:48:16.091] [DEBUG] -- exited code 0 [2025-09-08 14:48:16.092] [DEBUG] - sub get_client ref count to 0 [2025-09-08 14:48:16.092] [DEBUG] - export get_client [2025-09-08 14:48:16.092] [DEBUG] - plugin host_tool-py_script_get_client-1.0 result: True [2025-09-08 14:48:16.092] [DEBUG] - Searching init_user plugin for components ... [2025-09-08 14:48:16.092] [DEBUG] - Searching init_user plugin for host_tool-1.0--None [2025-09-08 14:48:16.093] [DEBUG] - Found for host_tool-py_script_init_user-1.0 for host_tool-1.0 [2025-09-08 14:48:16.093] [DEBUG] - Call plugin host_tool-py_script_init_user-1.0 for host_tool-1.0--None [2025-09-08 14:48:16.093] [DEBUG] - import init_user [2025-09-08 14:48:16.094] [DEBUG] - add init_user ref count to 1 [2025-09-08 14:48:16.094] [DEBUG] -- root@192.168.40.110 execute: id admin [2025-09-08 14:48:16.142] [DEBUG] -- exited code 1, error output: [2025-09-08 14:48:16.142] [DEBUG] id: admin: no such user [2025-09-08 14:48:16.142] [DEBUG] [2025-09-08 14:48:16.142] [INFO] Create user admin [2025-09-08 14:48:16.143] [DEBUG] -- root@192.168.40.110 execute: useradd -U admin -m -d /home/admin -s /bin/bash; chown -R admin /home/admin; [2025-09-08 14:48:16.226] [DEBUG] -- exited code 0 [2025-09-08 14:48:16.226] [INFO] Set admin
s password
[2025-09-08 14:48:16.226] [DEBUG] – root@192.168.40.110 execute: echo “admin:******” | chpasswd;
[2025-09-08 14:48:16.296] [DEBUG] – exited code 0
[2025-09-08 14:48:16.296] [DEBUG] – root@192.168.40.110 execute: -l -U admin
[2025-09-08 14:48:16.345] [DEBUG] – exited code 127, error output:
[2025-09-08 14:48:16.345] [DEBUG] bash: -l: command not found
[2025-09-08 14:48:16.345] [DEBUG]
[2025-09-08 14:48:16.345] [INFO] Configure passwordless sudo for admin
[2025-09-08 14:48:16.345] [DEBUG] – root@192.168.40.110 execute: echo "admin ALL=(ALL) NOPASSWD: ******
[2025-09-08 14:48:16.393] [DEBUG] – exited code 0
[2025-09-08 14:48:16.393] [INFO] Enable password login
[2025-09-08 14:48:16.394] [DEBUG] – root@192.168.40.110 execute: sed -i ‘s/^PasswordAuthentication no/PasswordAuthentication yes/’ /etc/ssh/sshd_config
[2025-09-08 14:48:16.443] [DEBUG] – exited code 0
[2025-09-08 14:48:16.443] [DEBUG] – root@192.168.40.110 execute: sed -i ‘s/^#PasswordAuthentication yes/PasswordAuthentication yes/’ /etc/ssh/sshd_config
[2025-09-08 14:48:16.491] [DEBUG] – exited code 0
[2025-09-08 14:48:16.492] [DEBUG] – root@192.168.40.110 execute: systemctl restart sshd
[2025-09-08 14:48:16.568] [DEBUG] – exited code 0
[2025-09-08 14:48:16.569] [INFO] Modify ulimit parameters
[2025-09-08 14:48:16.569] [DEBUG] – root@192.168.40.110 execute: bash -c “ulimit -a”
[2025-09-08 14:48:16.620] [DEBUG] – exited code 0
[2025-09-08 14:48:16.620] [DEBUG] – root@192.168.40.110 execute: echo -e “admin soft nofile 655350\nadmin hard nofile 655350” | tee -a /etc/security/limits.d/nofile.conf
[2025-09-08 14:48:16.671] [DEBUG] – exited code 0
[2025-09-08 14:48:16.671] [DEBUG] – root@192.168.40.110 execute: echo -e “admin soft nproc 655360\nadmin hard nproc 655360” | tee -a /etc/security/limits.d/nproc.conf
[2025-09-08 14:48:16.720] [DEBUG] – exited code 0
[2025-09-08 14:48:16.720] [DEBUG] – root@192.168.40.110 execute: echo -e “admin soft core unlimited\nadmin hard core unlimited” | tee -a /etc/security/limits.d/core.conf
[2025-09-08 14:48:16.769] [DEBUG] – exited code 0
[2025-09-08 14:48:16.769] [DEBUG] – root@192.168.40.110 execute: echo -e “admin soft stack unlimited\nadmin hard stack unlimited” | tee -a /etc/security/limits.d/stack.conf
[2025-09-08 14:48:16.817] [DEBUG] – exited code 0
[2025-09-08 14:48:16.817] [DEBUG] – 192.168.40.110: ( open files,max user processes,core file size,stack size ) have been successfully modified!
[2025-09-08 14:48:16.817] [INFO] 192.168.40.110: ( open files,max user processes,core file size,stack size… ) have been successfully modified!
[2025-09-08 14:48:16.818] [DEBUG] – host: 192.168.40.110, port: 22, user: admin, password: ******
[2025-09-08 14:48:16.895] [DEBUG] – admin@192.168.40.110 execute: bash -c “ulimit -a”
[2025-09-08 14:48:17.106] [DEBUG] – exited code 0
[2025-09-08 14:48:17.106] [DEBUG] – root@192.168.40.110 execute: ls /data/1
[2025-09-08 14:48:17.118] [DEBUG] – exited code 2, error output:
[2025-09-08 14:48:17.118] [DEBUG] ls: cannot access /data/1: No such file or directory
[2025-09-08 14:48:17.118] [DEBUG]
[2025-09-08 14:48:17.118] [WARNING] [WARN] cant find dir /data/1 [2025-09-08 14:48:17.119] [DEBUG] -- root@192.168.40.110 execute: ls /data/log1 [2025-09-08 14:48:17.169] [DEBUG] -- exited code 2, error output: [2025-09-08 14:48:17.169] [DEBUG] ls: cannot access /data/log1: No such file or directory [2025-09-08 14:48:17.169] [DEBUG] [2025-09-08 14:48:17.169] [WARNING] [WARN] can
t find dir /data/log1
[2025-09-08 14:48:17.169] [DEBUG] - sub init_user ref count to 0
[2025-09-08 14:48:17.169] [DEBUG] - export init_user
[2025-09-08 14:48:17.169] [DEBUG] - plugin host_tool-py_script_init_user-1.0 result: True
[2025-09-08 14:48:17.169] [DEBUG] - share lock /root/.obd/lock/global release, count 0
[2025-09-08 14:48:17.169] [DEBUG] - unlock /root/.obd/lock/global
[2025-09-08 14:48:17.169] [INFO] Trace ID: c6f6ba34-8c7f-11f0-8f14-000c29e13c26
[2025-09-08 14:48:17.169] [INFO] If you want to view detailed obd logs, please run: obd display-trace c6f6ba34-8c7f-11f0-8f14-000c29e13c26
不会创建的。cd到目录下看看
只设置 ulimit 参数和设置免密
-
修改目录所有者:若目标机器中存在
/data/1
和/data/log1
目录,将目录的所有者修改为指定的用户。
机器中不存在 /data/1
和 /data/log1
目录,需要手动创建么?
不需要
不需要创建,但是为啥会有告警呢?
就是个判断 忽略即可