2016-06-19 4 views
0

나는이 스크립트 (Nagios는 사용자에 의해) 스마트 읽으려고 해요 : https://gist.github.com/mastbaum/10663894#file-smart_watch-py서브 프로세스 : 이상한 오류 : [errno를 2] 해당 파일하거나 디렉토리

I 활성화 않았다 Nagios는 해당 파일 (은/etc /의 sudoers) 실행 :

nagios ALL= NOPASSWD: /git/check_smart/smart_watch.py 
#(later on for testing) 
nagios ALL= NOPASSWD: ALL 

내가 서브 프로세스 내에서 루트 권한을 얻을 확신을,이 장치에 대한 액세스가 부여되지 않은 것 같습니다 :

[email protected]:/dir$ sudo /git/check_smart/smart_watch.py --device /dev/sda 
Traceback (most recent call last): 
    File "/git/check_smart/smart_watch.py", line 48, in <module> 
    main(args.logfile, args.device) 
    File "/git/check_smart/smart_watch.py", line 18, in main 
    code = check_smart(device) 
    File "/git/check_smart/smart_watch.py", line 10, in check_smart 
    return subprocess.call(args) 
    File "/usr/lib/python2.7/subprocess.py", line 493, in call 
    return Popen(*popenargs, **kwargs).wait() 
    File "/usr/lib/python2.7/subprocess.py", line 679, in __init__ 
    errread, errwrite) 
    File "/usr/lib/python2.7/subprocess.py", line 1259, in _execute_child 
    raise child_exception 
OSError: [Errno 2] No such file or directory 

$ ls -lahtr /dev/sda 
brw-rw---- 1 root disk 8, 0 cze 13 14:55 /dev/sda 

명령이 완벽하게 실행되어 루트로 실행됩니다.

"No such file"오류가있는 이유는 무엇입니까? 내가 권한을 기대했는데 거부가 아니라/더 파일/

답변

2

이 그것을 찾을 수 없음

명령에서 smartclt을 발견되지 않았다

,로 변경 : 는/usr/sbin에/smartctl

+0

들으 @rrauenza 수 ' 그 버튼을 찾지 :/ – sirkubax

+0

upvote down 투표 버튼 옆에있는 작은 체크 표시 – rrauenza

관련 문제