Page 1 of 1

SCHEDULE_SERVICEGROUP_HOST_DOWNTIME command not found

Posted: Mon Sep 30, 2019 9:51 am
by Nighthawkz
Hi all

I am currently running core Version 4.0.6 & am trying to regularly set a host group in downtime - hopefully as a cron job.

looking through the docs i came across SCHEDULE_SERVICEGROUP_HOST_DOWNTIME which seems to do what i want. except i can't make it do so:lol:

If i run this:

Code: Select all

*/usr/local/nagios/var/rw/nagios/cmd SCHEDULE_SERVICEGROUP_HOST_DOWNTIME;Solaris dev servers;1110741500;1577666928;0;0;7200;test;test comment

from the shell either as root or user nagios i get "permission denied"


if i run it as a bash script (has permissions) as in the documentation here

https://assets.nagios.com/downloads/nag ... and_id=121

I get a "command not found" output

To me they're both the same thing just run in slightly different formats..but i get different error messages.

Am i missing something blindingly obvious here to get this working?

any help would be appreciated

regards

Re: SCHEDULE_SERVICEGROUP_HOST_DOWNTIME command not found

Posted: Mon Sep 30, 2019 10:11 am
by scottwilkerson
Nighthawkz wrote:To me they're both the same thing just run in slightly different formats..but i get different error messages.
These are not the same thing for sure.


What is the location of your nagios.cmd on your system?

Also, can you post the output of

Code: Select all

which printf

Re: SCHEDULE_SERVICEGROUP_HOST_DOWNTIME command not found

Posted: Tue Oct 01, 2019 2:16 am
by Nighthawkz
thanks for responding


nagios.cmd is in /usr/local/nagios/var/rw

which prinft output:

/usr/bin/prinft

Re: SCHEDULE_SERVICEGROUP_HOST_DOWNTIME command not found

Posted: Tue Oct 01, 2019 4:53 am
by Nighthawkz
I originally posted the wrong command i was trying to use

SCHEDULE_HOSTGROUP_HOST_DOWNTIME is the one i'm looking to use

regards

Re: SCHEDULE_SERVICEGROUP_HOST_DOWNTIME command not found

Posted: Tue Oct 01, 2019 5:42 am
by mahtabalam
Can you give me the contents of /etc/nagios/nagios.cfg
or /usr/local/nagios/nagios.cfg

Re: SCHEDULE_SERVICEGROUP_HOST_DOWNTIME command not found

Posted: Tue Oct 01, 2019 6:29 am
by scottwilkerson
Nighthawkz wrote:I originally posted the wrong command i was trying to use

SCHEDULE_HOSTGROUP_HOST_DOWNTIME is the one i'm looking to use

regards
You should be able to follow the doc here but change /bin/printf to /usr/bin/prinft
https://assets.nagios.com/downloads/na ... and_id=123

Re: SCHEDULE_SERVICEGROUP_HOST_DOWNTIME command not found

Posted: Wed Oct 02, 2019 4:10 am
by Nighthawkz
@scottwilkerson:

thanks, i have read through and tried. When I try it, the log just gives this generic error:

[1570007290] EXTERNAL COMMAND: SCHEDULE_HOSTGROUP_HOST_DOWNTIME;Windows Servers;1569921625;1569943225;0;0;7200;lciav;Test Comment
[1570007290] Error: External command failed -> SCHEDULE_HOSTGROUP_HOST_DOWNTIME;Windows Servers;1569921625;1569943225;0;0;7200;lciav;Test Comment
[1570007290] External command error: Command failed

Re: SCHEDULE_SERVICEGROUP_HOST_DOWNTIME command not found

Posted: Wed Oct 02, 2019 4:11 am
by Nighthawkz
@mahtabalam
mahtabalam wrote:Can you give me the contents of /etc/nagios/nagios.cfg
or /usr/local/nagios/nagios.cfg

i have attached it

thanks

Re: SCHEDULE_SERVICEGROUP_HOST_DOWNTIME command not found

Posted: Wed Oct 02, 2019 5:09 am
by Nighthawkz
OK

I solved it

i was typing in the host groups name wrong :oops: apologies for wasting everyone time!

you can delete or mark this thread as solved!

thanks again!

Re: SCHEDULE_SERVICEGROUP_HOST_DOWNTIME command not found

Posted: Wed Oct 02, 2019 6:31 am
by scottwilkerson
Nighthawkz wrote:OK

I solved it

i was typing in the host groups name wrong :oops: apologies for wasting everyone time!

you can delete or mark this thread as solved!

thanks again!
Great!

Locking