Bạn đang xem: Cgi configuration file options · nagios core documentation
I have a custom variable with quality specific IDs on every host. I have khổng lồ get the hostname by searching on ID. There is a documentation for CGI commands but I could not find the needed functionality: https://icinga.com/docs/icinga1/latest/en/cgiparams.html
UPD: I am using python for CGI requests. Maybe there is also a library to vị that.
Does anyone know, if it is possible?
Highest score (default) Trending (recent votes count more) Date modified (newest first) Date created (oldest first)
For Nagios at least, this is possible. You can điện thoại tư vấn the host details on the objectjson.cgi for a hostgroup and in your result.json(), you would have the custom_variables for each of the hosts. With that, you can bản đồ an ID lớn the hostname.
make your request khổng lồ https:///nagios/cgi-bin/objectjson.cgi?query=hostlist&details=true&hostgroup=
{... "data": "hostlist": "": .... "custom_variables": , "": .... untested! using python"s requests module:
hostlist = result.json().get("data").get("hostlist")id_map = hostlist.get(host).get("custom_variables").get("your_id_key"):host for host in hostlist.keys()
Reminder: Answers generated by artificial intelligence tools are not allowed on Stack Overflow. Learn more
Thanks for contributing an answer lớn Stack Overflow!
But avoid …
Asking for help, clarification, or responding khổng lồ other answers.Making statements based on opinion; back them up with references or personal experience.To learn more, see our tips on writing great answers.
Post Your Answer Discard
By clicking “Post Your Answer”, you agree khổng lồ our terms of service và acknowledge you have read our privacy policy.
Company cookie-settings#toggle" class="s-btn s-btn__link py4 js-gps-track -link" data-gps-track="footer.click( location: 2, link: 38 )" data-consent-popup-loader="footer">Cookie Settings
Site design / logo © 2024 Stack Exchange Inc; user contributions licensed under CC BY-SA. Rev2024.5.29.9948 I am running Nagios core 4.0.8 in my environment & I am looking to find a way lớn change the mặc định url from https://example.com/nagios khổng lồ https://example.com. Is there a way one can vị that?
Highest score (default) Trending (recent votes count more) Date modified (newest first) Date created (oldest first)
You will need to lớn edit the cgi.cfg file for Nagios.
Xem thêm: Dùng Index Trong Sql Sever Một Cách Dùng Index Sql Khi Sử Dụng
vim /usr/local/nagios/etc/cgi.cfg
Change url_html_path=/nagios to lớn url_html_path=/
Edit nagios.conf:
Change Script
Alias /nagios/cgi-bin "/usr/local/nagios/sbin" to
Script
Alias /cgi-bin "/usr/local/nagios/sbin"
Comment out the line Alias /nagios "/usr/local/nagios/share" & then showroom below
Document
Root /usr/local/nagios/share
Add the following at đứng đầu of the configuration:
Server
Name status.example.com
and showroom at the bottom.
Edit your /usr/local/nagios/share/config.inc.php file:
Change $cfg<"cgi_base_url">="/nagios/cgi-bin"; khổng lồ $cfg<"cgi_base_url">="/cgi-bin";
Restart Apache & Nagios
mô tả
Improve this answer
Follow
edited Sep 5, 2018 at 13:10
Paxz
2,99811 gold badge2020 silver badges3535 bronze badges
answered Feb 16, 2017 at 6:54
George Ulahannan
George Ulahannan
9111 silver badge66 bronze badges
2
địa chỉ cửa hàng a phản hồi |
3
If you are using Apache lớn serve your Nagios page you can vì different things. Apache configuration files are usually located in /etc/apache2/.
Probably your Document
Root is set lớn /var/www, so you can create a file named "index.html" and place this code inside it khổng lồ redirect khổng lồ /nagios URL:
You can also edit your nagios apache config (probably /etc/nagios/apache2.conf...) or apache config /etc/apache2/*.conf và add:
Redirect
Match ^/$ /nagios
If you don"t lượt thích these methods there are more, just think of it as using Apache khổng lồ redirect, not like a Nagios thing.
cốt truyện
Improve this answer
Follow
answered Feb 7, năm ngoái at 22:04
Xacosta
Xacosta
24611 silver badge44 bronze badges
1
địa chỉ a bình luận |
Your Answer
Reminder: Answers generated by artificial intelligence tools are not allowed on Stack Overflow. Learn more
Thanks for contributing an answer khổng lồ Stack Overflow!
But avoid …
Asking for help, clarification, or responding khổng lồ other answers.Making statements based on opinion; back them up with references or personal experience.To learn more, see our tips on writing great answers.
Draft saved
Draft discarded
Sign up or log in
Sign up using Google
Sign up using Facebook
Sign up using thư điện tử and Password
Submit
Post as a guest
Name
thư điện tử Required, but never shown
Post as a guest
Name
thư điện tử
Required, but never shown
Post Your Answer Discard
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Not the answer you're looking for? Browse other questions tagged or ask your own question.
The Overflow Blog Featured on Meta
Visit chat
Related
3
Changing tên miền url in web analytics
0
Trying to lớn modify the URL that gets displayed in web analytics
13
Monitoring URLs with Nagios
1
Inno setup Custom URL for Chrome
0
waht is the default address ip of nagios vps
1
How to change tomcat mặc định URL
1
How to lớn change a URL in Jenkins sidebar menu
0
How to change the default URL into custom URL in Mendix?
1
Change default URL in google analytics 4
0
Changing the format of the URL in Nette Application
Hot Network Questions more hot questions
Question feed
Subscribe lớn RSS
Question feed to subscribe to lớn this RSS feed, copy và paste this URL into your RSS reader.
Stack Overflow
Products
Company cookie-settings#toggle" class="s-btn s-btn__link py4 js-gps-track -link" data-gps-track="footer.click( location: 2, link: 38 )" data-consent-popup-loader="footer">Cookie Settings
Stack Exchange Network
Site kiến thiết / biệu tượng công ty © 2024 Stack Exchange Inc; user contributions licensed under CC BY-SA. Rev2024.5.29.9948