my script not work correctly but directly work on server

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
baber
Posts: 308
Joined: Wed Oct 21, 2015 4:39 am

Re: my script not work correctly but directly work on server

Post by baber »

eloyd wrote:I mean, on the remote server, is your NRPE running as the nagios user or some other user? Can you look at the end of /var/log/secure and post the last 50 lines or so?

this is secure log file on my remote server

Code: Select all

Aug 25 16:07:09 npmbsrv sshd[11607]: Did not receive identification string from 10.0.4.45
Aug 25 16:09:21 npmbsrv sshd[12455]: Did not receive identification string from 10.0.4.45
Aug 25 16:11:58 npmbsrv sshd[13817]: Did not receive identification string from 10.0.4.45
Aug 25 16:14:23 npmbsrv sshd[14699]: Did not receive identification string from 10.0.4.45
Aug 25 16:16:46 npmbsrv sshd[15955]: Did not receive identification string from 10.0.4.45
Aug 25 16:19:09 npmbsrv sshd[16826]: Did not receive identification string from 10.0.4.45
Aug 25 16:21:32 npmbsrv sshd[18352]: Did not receive identification string from 10.0.4.45
Aug 25 16:23:50 npmbsrv sshd[19099]: Did not receive identification string from 10.0.4.45
Aug 25 16:26:19 npmbsrv sshd[20335]: Did not receive identification string from 10.0.4.45
Aug 25 16:28:37 npmbsrv sshd[21138]: Did not receive identification string from 10.0.4.45
Aug 25 16:31:03 npmbsrv sshd[22417]: Did not receive identification string from 10.0.4.45
Aug 25 16:33:30 npmbsrv sshd[23265]: Did not receive identification string from 10.0.4.45
Aug 25 16:35:52 npmbsrv sshd[24768]: Did not receive identification string from 10.0.4.45
Aug 25 16:38:13 npmbsrv sshd[25651]: Did not receive identification string from 10.0.4.45
Aug 25 16:40:34 npmbsrv sshd[26910]: Did not receive identification string from 10.0.4.45
Aug 25 16:43:00 npmbsrv sshd[27757]: Did not receive identification string from 10.0.4.45
Aug 25 16:45:19 npmbsrv sshd[28845]: Did not receive identification string from 10.0.4.45
Aug 25 16:46:19 npmbsrv sshd[29269]: Accepted password for root from 10.0.4.73 port 60436 ssh2
Aug 25 16:46:19 npmbsrv sshd[29269]: pam_unix(sshd:session): session opened for user root by (uid=0)
Aug 25 16:46:19 npmbsrv sshd[29269]: Received disconnect from 10.0.4.73: 11: disconnected by user
Aug 25 16:46:19 npmbsrv sshd[29269]: pam_unix(sshd:session): session closed for user root
Aug 25 16:46:32 npmbsrv sshd[29310]: Accepted password for root from 10.11.2.131 port 52980 ssh2
Aug 25 16:46:32 npmbsrv sshd[29310]: pam_unix(sshd:session): session opened for user root by (uid=0)
Aug 25 16:47:50 npmbsrv sshd[29925]: Did not receive identification string from 10.0.4.45
Aug 25 16:48:10 npmbsrv useradd[30025]: failed adding user 'nagios', data deleted
Aug 25 16:50:13 npmbsrv sshd[53705]: Did not receive identification string from 10.0.4.45
Aug 25 16:52:32 npmbsrv sshd[54558]: Did not receive identification string from 10.0.4.45
Aug 25 16:52:32 npmbsrv sshd[54556]: Accepted password for root from 10.11.2.131 port 53225 ssh2
Aug 25 16:52:32 npmbsrv sshd[54556]: pam_unix(sshd:session): session opened for user root by (uid=0)
Aug 25 16:52:33 npmbsrv sshd[54556]: subsystem request for sftp
Aug 25 16:53:54 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 16:53:54 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller slot=0 logicaldrive all show
Aug 25 16:53:55 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller slot=0 physicaldrive all show
Aug 25 16:54:00 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 16:54:00 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller slot=0 logicaldrive all show
Aug 25 16:54:01 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller slot=0 physicaldrive all show
Aug 25 16:54:57 npmbsrv sshd[55764]: Did not receive identification string from 10.0.4.45
Aug 25 16:56:05 npmbsrv sshd[56615]: Connection closed by 10.0.4.73
Aug 25 16:57:15 npmbsrv sshd[57067]: Did not receive identification string from 10.0.4.45
Aug 25 16:58:13 npmbsrv sshd[57491]: Accepted password for root from 10.11.2.131 port 53485 ssh2
Aug 25 16:58:13 npmbsrv sshd[57491]: pam_unix(sshd:session): session opened for user root by (uid=0)
Aug 25 16:58:13 npmbsrv sshd[57491]: subsystem request for sftp
Aug 25 16:58:17 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 16:58:43 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 16:58:44 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller slot=0 logicaldrive all show
Aug 25 16:58:45 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller slot=0 physicaldrive all show
Aug 25 16:59:15 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 16:59:15 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller slot=0 logicaldrive all show
Aug 25 16:59:16 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller slot=0 physicaldrive all show
Aug 25 16:59:38 npmbsrv sshd[58303]: Did not receive identification string from 10.0.4.45
Aug 25 17:01:04 npmbsrv sshd[59182]: Connection closed by 10.0.4.73
Aug 25 17:02:06 npmbsrv sshd[59628]: Did not receive identification string from 10.0.4.45
Aug 25 17:04:36 npmbsrv sshd[60512]: Did not receive identification string from 10.0.4.45
Aug 25 17:04:40 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 17:04:40 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller slot=0 logicaldrive all show
Aug 25 17:04:41 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller slot=0 physicaldrive all show
Aug 25 17:04:59 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 17:05:03 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 17:05:14 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 17:05:18 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 17:05:22 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 17:06:04 npmbsrv sshd[61918]: Connection closed by 10.0.4.73
Aug 25 17:06:29 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -s
Aug 25 17:06:33 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -s
Aug 25 17:06:37 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -s
Aug 25 17:06:41 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -s
Aug 25 17:06:47 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -s
Aug 25 17:06:51 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -s
Aug 25 17:06:55 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -s
Aug 25 17:06:59 npmbsrv sshd[62298]: Did not receive identification string from 10.0.4.45
Aug 25 17:07:18 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -s
Aug 25 17:07:58 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -s
Aug 25 17:07:58 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 17:07:58 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller slot=0 logicaldrive all show
Aug 25 17:07:59 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller slot=0 physicaldrive all show
Aug 25 17:09:23 npmbsrv sshd[63368]: Did not receive identification string from 10.0.4.45
Aug 25 17:11:04 npmbsrv sshd[64530]: Connection closed by 10.0.4.73
Aug 25 17:11:45 npmbsrv sshd[64760]: Did not receive identification string from 10.0.4.45
Aug 25 17:12:06 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -s
Aug 25 17:12:10 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -s
Aug 25 17:12:13 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -s
Aug 25 17:12:17 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -s
Aug 25 17:12:21 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -s
Aug 25 17:12:26 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -s
Aug 25 17:12:30 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -s
Aug 25 17:14:05 npmbsrv sshd[513]: Did not receive identification string from 10.0.4.45
Aug 25 17:16:04 npmbsrv sshd[1693]: Connection closed by 10.0.4.73
Aug 25 17:16:34 npmbsrv sshd[1810]: Did not receive identification string from 10.0.4.45
Aug 25 17:17:30 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -s
Aug 25 17:18:54 npmbsrv sshd[2834]: Did not receive identification string from 10.0.4.45
Aug 25 17:21:04 npmbsrv sshd[4583]: Connection closed by 10.0.4.73
Aug 25 17:21:20 npmbsrv sshd[4587]: Did not receive identification string from 10.0.4.45
Aug 25 17:21:40 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 17:21:44 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 17:21:53 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 17:21:57 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 17:22:36 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 17:22:39 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 17:22:43 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 17:22:48 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 17:22:52 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 17:23:48 npmbsrv sshd[5681]: Did not receive identification string from 10.0.4.45
Aug 25 17:25:45 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 17:25:48 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 17:25:53 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 17:25:56 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 17:26:00 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 17:26:04 npmbsrv sshd[7072]: Connection closed by 10.0.4.73
Aug 25 17:26:08 npmbsrv sshd[7074]: Did not receive identification string from 10.0.4.45
Aug 25 17:28:31 npmbsrv sshd[7968]: Did not receive identification string from 10.0.4.45
Aug 25 17:30:53 npmbsrv sshd[9245]: Did not receive identification string from 10.0.4.45
Aug 25 17:30:59 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 17:31:04 npmbsrv sshd[9288]: Connection closed by 10.0.4.73
Aug 25 17:33:19 npmbsrv sshd[10131]: Did not receive identification string from 10.0.4.45
Aug 25 17:35:40 npmbsrv sshd[11480]: Did not receive identification string from 10.0.4.45
Aug 25 17:35:58 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 17:36:04 npmbsrv sshd[11716]: Connection closed by 10.0.4.73
Aug 25 17:38:09 npmbsrv sshd[12492]: Did not receive identification string from 10.0.4.45
Aug 25 17:39:25 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 17:39:25 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller slot=0 logicaldrive all show
Aug 25 17:39:26 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller slot=0 physicaldrive all show
Aug 25 17:39:40 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 17:39:40 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller slot=0 logicaldrive all show
Aug 25 17:39:41 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller slot=0 physicaldrive all show
Aug 25 17:40:26 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 17:40:26 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller slot=0 logicaldrive all show
Aug 25 17:40:27 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller slot=0 physicaldrive all show
Aug 25 17:40:30 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 17:40:30 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller slot=0 logicaldrive all show
Aug 25 17:40:31 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller slot=0 physicaldrive all show
Aug 25 17:40:32 npmbsrv sshd[14308]: Did not receive identification string from 10.0.4.45
Aug 25 17:40:58 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 17:41:04 npmbsrv sshd[14549]: Connection closed by 10.0.4.73
Aug 25 17:42:55 npmbsrv sshd[15205]: Did not receive identification string from 10.0.4.45
Aug 25 17:45:20 npmbsrv sshd[16497]: Did not receive identification string from 10.0.4.45
Aug 25 17:45:48 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -v -p
Aug 25 17:45:52 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -v -p
Aug 25 17:45:55 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -v -p
Aug 25 17:46:04 npmbsrv sshd[16732]: Connection closed by 10.0.4.73
Aug 25 17:47:39 npmbsrv sshd[17385]: Did not receive identification string from 10.0.4.45
Aug 25 17:50:04 npmbsrv sshd[18608]: Did not receive identification string from 10.0.4.45
Aug 25 17:50:55 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -v -p
Aug 25 17:51:04 npmbsrv sshd[19187]: Connection closed by 10.0.4.73
Aug 25 17:52:35 npmbsrv sshd[19814]: Did not receive identification string from 10.0.4.45
Aug 25 17:55:01 npmbsrv sshd[20687]: Did not receive identification string from 10.0.4.45
Aug 25 17:55:55 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -v -p
Aug 25 17:56:04 npmbsrv sshd[21541]: Connection closed by 10.0.4.73
Aug 25 17:57:24 npmbsrv sshd[22009]: Did not receive identification string from 10.0.4.45
Aug 25 17:59:47 npmbsrv sshd[22878]: Did not receive identification string from 10.0.4.45
Aug 25 18:00:55 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -v -p
Aug 25 18:01:04 npmbsrv sshd[23762]: Connection closed by 10.0.4.73
Aug 25 18:02:12 npmbsrv sshd[24221]: Did not receive identification string from 10.0.4.45
Aug 25 18:04:35 npmbsrv sshd[25063]: Did not receive identification string from 10.0.4.45
Aug 25 18:05:55 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -v -p
Aug 25 18:06:04 npmbsrv sshd[26194]: Connection closed by 10.0.4.73
Aug 25 18:07:04 npmbsrv sshd[26628]: Did not receive identification string from 10.0.4.45
Aug 25 18:09:26 npmbsrv sshd[27321]: Did not receive identification string from 10.0.4.45
Aug 25 18:10:55 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -v -p
Aug 25 18:11:04 npmbsrv sshd[28489]: Connection closed by 10.0.4.73
Aug 25 18:11:52 npmbsrv sshd[28708]: Did not receive identification string from 10.0.4.45
Aug 25 18:14:19 npmbsrv sshd[29618]: Did not receive identification string from 10.0.4.45
Aug 25 18:15:55 npmbsrv sudo:   nagios : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -v -p
Aug 25 18:16:04 npmbsrv sshd[30693]: Connection closed by 10.0.4.73
Aug 25 18:16:40 npmbsrv sshd[30907]: Did not receive identification string from 10.0.4.45
Aug 25 18:17:29 npmbsrv sudo:   nagios : no tty present and no askpass program specified ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:17:34 npmbsrv sudo:   nagios : no tty present and no askpass program specified ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:17:39 npmbsrv sudo:   nagios : no tty present and no askpass program specified ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:17:49 npmbsrv sudo:   nagios : no tty present and no askpass program specified ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:17:53 npmbsrv sudo:   nagios : no tty present and no askpass program specified ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:17:57 npmbsrv sudo:   nagios : no tty present and no askpass program specified ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:18:13 npmbsrv sudo:   nagios : no tty present and no askpass program specified ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:18:17 npmbsrv sudo:   nagios : no tty present and no askpass program specified ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:18:20 npmbsrv sudo:   nagios : no tty present and no askpass program specified ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:18:53 npmbsrv sudo:   nagios : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -v -p
Aug 25 18:18:53 npmbsrv sudo:     root : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:18:57 npmbsrv sudo:   nagios : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -v -p
Aug 25 18:18:57 npmbsrv sudo:     root : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:19:01 npmbsrv sudo:   nagios : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -v -p
Aug 25 18:19:01 npmbsrv sudo:     root : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:19:03 npmbsrv sshd[32021]: Did not receive identification string from 10.0.4.45
Aug 25 18:19:05 npmbsrv sudo:   nagios : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -v -p
Aug 25 18:19:05 npmbsrv sudo:     root : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:19:09 npmbsrv sudo:   nagios : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -v -p
Aug 25 18:19:09 npmbsrv sudo:     root : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:21:04 npmbsrv sshd[33408]: Connection closed by 10.0.4.73
Aug 25 18:21:26 npmbsrv sshd[33606]: Did not receive identification string from 10.0.4.45
Aug 25 18:21:29 npmbsrv sudo:   nagios : no tty present and no askpass program specified ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:21:33 npmbsrv sudo:   nagios : no tty present and no askpass program specified ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:21:37 npmbsrv sudo:   nagios : no tty present and no askpass program specified ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:21:40 npmbsrv sudo:   nagios : no tty present and no askpass program specified ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:23:52 npmbsrv sshd[34571]: Did not receive identification string from 10.0.4.45
Aug 25 18:26:04 npmbsrv sshd[35679]: Connection closed by 10.0.4.73
Aug 25 18:26:13 npmbsrv sshd[35792]: Did not receive identification string from 10.0.4.45
Aug 25 18:26:40 npmbsrv sudo:   nagios : no tty present and no askpass program specified ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:28:41 npmbsrv sshd[36778]: Did not receive identification string from 10.0.4.45
Aug 25 18:31:03 npmbsrv sshd[37892]: Did not receive identification string from 10.0.4.45
Aug 25 18:31:04 npmbsrv sshd[37907]: Connection closed by 10.0.4.73
Aug 25 18:31:40 npmbsrv sudo:   nagios : no tty present and no askpass program specified ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:33:23 npmbsrv sshd[38783]: Did not receive identification string from 10.0.4.45
Aug 25 18:35:50 npmbsrv sshd[40292]: Did not receive identification string from 10.0.4.45
Aug 25 18:36:04 npmbsrv sshd[40513]: Connection closed by 10.0.4.73
Aug 25 18:36:40 npmbsrv sudo:   nagios : no tty present and no askpass program specified ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:38:07 npmbsrv sshd[41214]: Did not receive identification string from 10.0.4.45
Aug 25 18:39:19 npmbsrv sudo:   nagios : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -v -p
Aug 25 18:39:19 npmbsrv sudo:     root : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:39:23 npmbsrv sudo:   nagios : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -v -p
Aug 25 18:39:23 npmbsrv sudo:     root : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:39:28 npmbsrv sudo:   nagios : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -v -p
Aug 25 18:39:28 npmbsrv sudo:     root : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:39:31 npmbsrv sudo:   nagios : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -v -p
Aug 25 18:39:31 npmbsrv sudo:     root : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:39:35 npmbsrv sudo:   nagios : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -v -p
Aug 25 18:39:35 npmbsrv sudo:     root : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:40:33 npmbsrv sshd[42593]: Did not receive identification string from 10.0.4.45
Aug 25 18:41:04 npmbsrv sshd[42819]: Connection closed by 10.0.4.73
Aug 25 18:42:59 npmbsrv sshd[43480]: Did not receive identification string from 10.0.4.45
Aug 25 18:44:35 npmbsrv sudo:   nagios : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -v -p
Aug 25 18:44:35 npmbsrv sudo:     root : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:45:24 npmbsrv sshd[44794]: Did not receive identification string from 10.0.4.45
Aug 25 18:46:04 npmbsrv sshd[45022]: Connection closed by 10.0.4.73
Aug 25 18:47:45 npmbsrv sshd[45682]: Did not receive identification string from 10.0.4.45
Aug 25 18:49:35 npmbsrv sudo:   nagios : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -v -p
Aug 25 18:49:35 npmbsrv sudo:     root : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:50:07 npmbsrv sshd[47231]: Did not receive identification string from 10.0.4.45
Aug 25 18:51:04 npmbsrv sshd[47461]: Connection closed by 10.0.4.73
Aug 25 18:52:30 npmbsrv sshd[47919]: Did not receive identification string from 10.0.4.45
Aug 25 18:53:24 npmbsrv su: pam_unix(su-l:session): session opened for user nagios by root(uid=0)
Aug 25 18:53:24 npmbsrv su: pam_unix(su-l:session): session closed for user nagios
Aug 25 18:54:35 npmbsrv sudo:   nagios : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -v -p
Aug 25 18:54:35 npmbsrv sudo:     root : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:54:47 npmbsrv sshd[48804]: Did not receive identification string from 10.0.4.45
Aug 25 18:56:04 npmbsrv sshd[49663]: Connection closed by 10.0.4.73
Aug 25 18:56:44 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:56:45 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller slot=0 logicaldrive all show
Aug 25 18:56:45 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller slot=0 physicaldrive all show
Aug 25 18:56:54 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:56:54 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller slot=0 logicaldrive all show
Aug 25 18:56:55 npmbsrv sudo:     root : TTY=pts/2 ; PWD=/usr/local/nagios/libexec ; USER=root ; COMMAND=/usr/sbin/hpacucli controller slot=0 physicaldrive all show
Aug 25 18:57:18 npmbsrv sshd[50430]: Did not receive identification string from 10.0.4.45
Aug 25 18:59:35 npmbsrv sudo:   nagios : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -v -p
Aug 25 18:59:35 npmbsrv sudo:     root : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 18:59:38 npmbsrv sshd[51476]: Did not receive identification string from 10.0.4.45
Aug 25 19:01:04 npmbsrv sshd[52363]: Connection closed by 10.0.4.73
Aug 25 19:02:03 npmbsrv sshd[52797]: Did not receive identification string from 10.0.4.45
Aug 25 19:04:35 npmbsrv sudo:   nagios : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_cciss-1.12 -v -p
Aug 25 19:04:35 npmbsrv sudo:     root : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/hpacucli controller all show status
Aug 25 19:04:38 npmbsrv sshd[53706]: Did not receive identification string from 10.0.4.45
Aug 25 19:06:04 npmbsrv sshd[54863]: Connection closed by 10.0.4.73
Aug 25 19:06:57 npmbsrv sshd[55213]: Did not receive identification string from 10.0.4.45

Last edited by dwhitfield on Tue Nov 22, 2016 12:58 pm, edited 2 times in total.
Reason: "ths" to "this"
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: my script not work correctly but directly work on server

Post by eloyd »

Try changing the sudo line to include the entire arguments as well:

Code: Select all

/usr/local/nagios/libexec/check_cciss-1.12 -v -p
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
baber
Posts: 308
Joined: Wed Oct 21, 2015 4:39 am

Re: my script not work correctly but directly work on server

Post by baber »

eloyd wrote:Try changing the sudo line to include the entire arguments as well:

Code: Select all

/usr/local/nagios/libexec/check_cciss-1.12 -v -p

in /etc/sudoers

change from

Code: Select all

# NEEDED TO ALLOW NAGIOS TO CHECK SERVICE STATUS
Defaults:nagios !requiretty
nagios ALL=NOPASSWD:/usr/local/nagios/libexec/check_cciss-1.12

to

Code: Select all

# NEEDED TO ALLOW NAGIOS TO CHECK SERVICE STATUS
Defaults:nagios !requiretty
nagios ALL=NOPASSWD:/usr/local/nagios/libexec/check_cciss-1.12 -v -p

but this error appear

Code: Select all

RAID UNKNOWN - /usr/sbin/hpacucli did not execute properly : sudo: sorry, you must have a tty to run sudo
i am realy confused

do i have to di any changes on nagios server or no ?
Last edited by baber on Thu Aug 25, 2016 10:04 am, edited 1 time in total.
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: my script not work correctly but directly work on server

Post by eloyd »

Does your script have a sudo command in it as well? It looks like it might. If it does, take that out and just use the sudo from the command line to run the script as root.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
baber
Posts: 308
Joined: Wed Oct 21, 2015 4:39 am

Re: my script not work correctly but directly work on server

Post by baber »

eloyd wrote:Does your script have a sudo command in it as well? It looks like it might. If it does, take that out and just use the sudo from the command line to run the script as root.

my problem has been solved

have to add these line in end of sudoers file

Code: Select all

nagios      ALL=NOPASSWD: /usr/sbin/hpacucli
Defaults:nagios !requiretty
nagios ALL=NOPASSWD:/usr/local/nagios/libexec/check_cciss-1.12 -v -p

So thanks
Best regards
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: my script not work correctly but directly work on server

Post by eloyd »

Glad I could help.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: my script not work correctly but directly work on server

Post by bwallace »

Once again, nice work eloyd! Locking this one up now....
Be sure to check out the Knowledgebase for helpful articles and solutions!
Locked