Nagios Core: Restart custom service from service page ui

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.
Locked
anjali
Posts: 14
Joined: Wed May 29, 2019 6:23 am

Nagios Core: Restart custom service from service page ui

Post by anjali »

Nagios Core: I made some custom service for example "casa-dashboard-service" and I add a restart button in service page. Now i want to restart that service when user click on restart button. I added button in service page infront of each service whose status is critical and when click on that button it redirect to page where service name, host name is displayed in text field with commit and reset button. Now what i want is when user click on commit button my another bash script get executed in which i wrote "systemctl restart casa-dashboard.service". But it throw an error
Warning: Unrecognized external command -> CASA_RESTART_SERVICE;home_server;Casadigi Dashboard Service;1559309957
External command error: Unknown or unsupported command. So please give me a solution to solve that problem
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Core: Restart custom service from service page ui

Post by scottwilkerson »

I don't understand what you are trying to do, the external command CASA_RESTART_SERVICE isn't a valid nagios external command

Check out the following to see valid external command you can run in Nagios
https://assets.nagios.com/downloads/nag ... ernalcmds/
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
anjali
Posts: 14
Joined: Wed May 29, 2019 6:23 am

Re: Nagios Core: Restart custom service from service page ui

Post by anjali »

I want to add my custom commands in nagios external command. When user click on restart button from service listing page than with the help of that custom command i want to restart my service. Now i need your help to achieve that .
anjali
Posts: 14
Joined: Wed May 29, 2019 6:23 am

Re: Nagios Core: Restart custom service from service page ui

Post by anjali »

scottwilkerson wrote:I don't understand what you are trying to do, the external command CASA_RESTART_SERVICE isn't a valid nagios external command

Check out the following to see valid external command you can run in Nagios
https://assets.nagios.com/downloads/nag ... ernalcmds/
Hello, I attach an image to clear you more what i want to do. In that image you can see Restart the service link which i highlighted in purple colour. Now what i need is when i click on that restart link my some bash script get executed in which i write restart script command.
Attachments
imageedit_2_5831624154.gif
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Core: Restart custom service from service page ui

Post by scottwilkerson »

anjali wrote:I want to add my custom commands in nagios external command. When user click on restart button from service listing page than with the help of that custom command i want to restart my service. Now i need your help to achieve that .
You would need to modify the C code of the project to create such a command, I cannot assist with this.

https://github.com/NagiosEnterprises/nagioscore
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked