tag:blogger.com,1999:blog-71618447692815053512024-02-20T11:56:55.796-08:00OpenCSWThis blog is about the OpenCSW Solaris packaging community.Dagobert Michelsenhttp://www.blogger.com/profile/00917619439571581481noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-7161844769281505351.post-84790818771127642302015-06-25T08:11:00.000-07:002015-06-25T08:11:08.018-07:00Metrics with CollectD and Graphite<span style="font-family: inherit;">CollectD is a daemon which periodically c</span>ollects system performance statistics. It can write the data to different destinations including csv-files, rrdtool and Graphite.<br />
<br />
<h2>
Installation</h2>
<br />
The installation can be done with pkgutil:<br />
<br />
<span style="background-color: #eeeeee; font-family: Courier New, Courier, monospace;"># pkgutil -y -i collectd</span><br />
<br />
The configuration file is located at <span style="font-family: Courier New, Courier, monospace;">/etc/opt/csw/collectd.conf</span><span style="font-family: inherit;">. Make sure to comment out rrdtool as we want to use Graphite as destination:</span><br />
<br />
<div class="p1">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;">#LoadPlugin rrdtool</span></span></div>
<div class="p1">
<br />
Then activate the Graphite plugin:</div>
<div style="-webkit-text-stroke-width: 0px; color: black; font-size: medium; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;">
<div style="font-weight: normal; margin: 0px;">
</div>
<div class="p1" style="font-weight: normal;">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;"><br /></span></span>
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;">LoadPlugin write_graphite</span></span></div>
<div class="p1">
<span style="background-color: white;"><span style="font-family: inherit;"><br /></span></span>
<span style="background-color: white;"><span style="font-family: inherit;">and make sure to configure the graphite plugin accordingly (there is an example down in the config file):</span></span></div>
<div class="p1" style="font-weight: normal;">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;"><br /></span></span></div>
<div class="p1" style="font-weight: normal;">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;"><Plugin write_graphite></span></span></div>
<div class="p1" style="font-weight: normal;">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;"> <Node "stats"></span></span></div>
<div class="p1" style="font-weight: normal;">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;"> Prefix "server."</span></span></div>
<div class="p1" style="font-weight: normal;">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;"> Postfix ".collectd"</span></span></div>
<div class="p1" style="font-weight: normal;">
<span style="background-color: #eeeeee; font-family: Courier New, Courier, monospace;"> </Node></span></div>
<div class="p1" style="font-weight: normal;">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;">
</span></span></div>
<div class="p1" style="font-weight: normal;">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;"></Plugin></span></span></div>
<div class="p1" style="font-weight: normal;">
<span class="s1"><br /></span></div>
<div class="p1" style="font-weight: normal;">
Then restart CollectD and the metrics should be flowing in to Graphite:<br />
<br />
<span style="background-color: #eeeeee; font-family: Courier New, Courier, monospace;"># svcadm restart cswcollectd</span><br />
<br />
Make sure to reload the webpage of Graphite-Web to show the new metrics.</div>
</div>
Anonymoushttp://www.blogger.com/profile/02126416898309697114noreply@blogger.com0tag:blogger.com,1999:blog-7161844769281505351.post-43569458815622236242015-06-25T07:11:00.000-07:002015-06-25T07:11:25.708-07:00Collecting Metrics with Graphite<div>
Graphite is a tool for storing and visualizing metrics. In this post we are installing Graphite from OpenCSW packages and do some basic configuration. The steps follow the tutorial presented in <a href="http://kartar.net/2015/01/using-riemann-for-metrics/">http://kartar.net/2015/01/using-riemann-for-metrics/</a> and focuses on the issues which differ, so reading up the original article after this brief tutorial is helpful.<br />
<br />
<h2>
<span style="font-family: inherit;">Installing Graphite</span></h2>
<div>
<br />
There are three parts which make up a Graphite installation:<br />
<br />
<ol>
<li>A database library called Whisper (package <span style="font-family: Courier New, Courier, monospace;">CSWpy-whisper</span>)</li>
<li>A storage engine called Carbon (package <span style="font-family: Courier New, Courier, monospace;">CSWpy-carbon</span>)</li>
<li>A web interface (package <span style="font-family: Courier New, Courier, monospace;">CSWgraphite-web</span>)</li>
</ol>
<br />
For simplicity we will install all packages on a single host. As the web interface automatically pulls in necessary dependencies it is sufficient to do<br />
<span style="font-family: inherit;"><br /></span>
<br />
<div>
<span style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;"># pkgutil -y -i graphite_web</span></span></div>
<div style="min-height: 14px;">
</div>
</div>
<h2 style="min-height: 14px;">
Configuring Graphite</h2>
<div>
<br />
<span style="font-family: inherit;">Important locations:</span><br />
<br />
<ul>
<li><span style="font-family: inherit;">configuration files: </span><span style="font-family: Courier New, Courier, monospace;">/etc/opt/csw/graphite</span></li>
<li><span style="font-family: inherit;">log files: </span><span style="font-family: Courier New, Courier, monospace;">/var/opt/csw/graphite/log</span><span style="font-family: inherit;"> and especially </span><span style="font-family: 'Courier New', Courier, monospace;">/var/opt/csw/graphite/log/webapp/error.log</span></li>
<li><span style="font-family: inherit;">data files: </span><span style="font-family: Courier New, Courier, monospace;">/var/opt/csw/graphite/whisper</span></li>
</ul>
</div>
</div>
<div style="min-height: 14px;">
<span style="font-family: inherit;">First we need to edit </span><span style="font-family: Courier New, Courier, monospace;">/etc/opt/csw/graphite/local_settings.py</span><span style="font-family: inherit;"> by changing the values for </span><span style="font-family: Courier New, Courier, monospace;">SECRET_KEY</span><span style="font-family: inherit;"> and </span><span style="font-family: Courier New, Courier, monospace;">TIME_ZONE</span><span style="font-family: inherit;">. The secret key is used to salt hashes for the authentication. A decent secret key can be generated with</span><br />
<br />
<br />
<div class="p1">
<span style="background-color: #eeeeee; font-family: Courier New, Courier, monospace;"><span class="s1"># cat /dev/urandom | tr -dc </span><span class="s2">'a-zA-Z0-9'</span><span class="s1"> | fold -w </span><span class="s3">256</span><span class="s1"> | head -1</span>
</span></div>
<div class="p1">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;">-zAZa9a-A0zA99Z0-9-ZZZZAZ-ZAA9za09zZZ-9A00-zZ-A9ZZ99zzazzz-00za-Za-A-0z-z99aZaz0a0zaaAzAZZ0Za-a9z99-A0-AZ0-99A--zZaAz0a90zZ00-AZZ0aazzzZZ9A-0aA9aZ9-ZAZ0Z0AzAZ90aZ0a09AA9-a-zA9Aa-90aAAa-0ZA-090zZaAAa0ZZAzZza9a9a-A0-a-Za-09aaa-Zzz90Z0Z99a9azzzaa-0--zZzZA-ZA9</span></span></div>
<div class="p1">
<span style="background-color: #eeeeee; font-family: Courier New, Courier, monospace;"><span class="s1"><br /></span></span></div>
<span style="font-family: inherit;">The lines in local_settings.py should then read:</span><br />
<span style="background-color: #eeeeee; font-family: Courier New, Courier, monospace;">SECRET_KEY='-zAZa9a-A0zA99Z0-9-ZZZZAZ-ZAA9za09zZZ-9A00-zZ-A9ZZ99zzazzz-00za-Za-A-0z-z99aZaz0a0zaaAzAZZ0Za-a9z99-A0-AZ0-99A--zZaAz0a90zZ00-AZZ0aazzzZZ9A-0aA9aZ9-ZAZ0Z0AzAZ90aZ0a09AA9-a-zA9Aa-90aAAa-0ZA-090zZaAAa0ZZAzZza9a9a-A0-a-Za-09aaa-Zzz90Z0Z99a9azzzaa-0--zZzZA-ZA9'</span><br />
<span style="background-color: #eeeeee; font-family: Courier New, Courier, monospace;">TIME_ZONE = 'Europe/Berlin'</span><br />
<div>
<span style="background-color: #eeeeee; font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div>
<span style="background-color: #eeeeee; font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div>
<span style="background-color: white;"><span style="font-family: inherit;">Now the database can be populated with</span></span></div>
<div class="p1">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;"># graphite-manage syncdb</span></span></div>
<div class="p2">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;">Operations to perform:</span></span></div>
<div class="p1">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;"> Synchronize unmigrated apps: account, cli, render, whitelist, metrics, url_shortener, dashboard, composer, events, browser</span></span></div>
<div class="p1">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;"> Apply all migrations: admin, contenttypes, tagging, auth, sessions</span></span></div>
<div class="p2">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;">Synchronizing apps without migrations:</span></span></div>
<div class="p1">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;"> Creating tables...</span></span></div>
<div class="p1">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;"> Creating table account_profile</span></span></div>
<div class="p1">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;"> Creating table account_variable</span></span></div>
<div class="p1">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;"> Creating table account_view</span></span></div>
<div class="p1">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;"> Creating table account_window</span></span></div>
<div class="p1">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;"> Creating table account_mygraph</span></span></div>
<div class="p1">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;"> Creating table dashboard_dashboard</span></span></div>
<div class="p1">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;"> Creating table events_event</span></span></div>
<div class="p1">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;"> Creating table url_shortener_link</span></span></div>
<div class="p1">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;"> Running deferred SQL...</span></span></div>
<div class="p1">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;"> Installing custom SQL...</span></span></div>
<div class="p2">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;">Running migrations:</span></span></div>
<div class="p1">
<span style="background-color: #eeeeee; font-family: Courier New, Courier, monospace;"><span class="s1"> Rendering model states...</span><span class="s2"> DONE</span></span></div>
<div class="p1">
<span style="background-color: #eeeeee; font-family: Courier New, Courier, monospace;"><span class="s1"> Applying contenttypes.0001_initial...</span><span class="s2"> OK</span></span></div>
<div class="p1">
<span style="background-color: #eeeeee; font-family: Courier New, Courier, monospace;"><span class="s1"> Applying auth.0001_initial...</span><span class="s2"> OK</span></span></div>
<div class="p1">
<span style="background-color: #eeeeee; font-family: Courier New, Courier, monospace;"><span class="s1"> Applying admin.0001_initial...</span><span class="s2"> OK</span></span></div>
<div class="p1">
<span style="background-color: #eeeeee; font-family: Courier New, Courier, monospace;"><span class="s1"> Applying contenttypes.0002_remove_content_type_name...</span><span class="s2"> OK</span></span></div>
<div class="p1">
<span style="background-color: #eeeeee; font-family: Courier New, Courier, monospace;"><span class="s1"> Applying auth.0002_alter_permission_name_max_length...</span><span class="s2"> OK</span></span></div>
<div class="p1">
<span style="background-color: #eeeeee; font-family: Courier New, Courier, monospace;"><span class="s1"> Applying auth.0003_alter_user_email_max_length...</span><span class="s2"> OK</span></span></div>
<div class="p1">
<span style="background-color: #eeeeee; font-family: Courier New, Courier, monospace;"><span class="s1"> Applying auth.0004_alter_user_username_opts...</span><span class="s2"> OK</span></span></div>
<div class="p1">
<span style="background-color: #eeeeee; font-family: Courier New, Courier, monospace;"><span class="s1"> Applying auth.0005_alter_user_last_login_null...</span><span class="s2"> OK</span></span></div>
<div class="p1">
<span style="background-color: #eeeeee; font-family: Courier New, Courier, monospace;"><span class="s1"> Applying auth.0006_require_contenttypes_0002...</span><span class="s2"> OK</span></span></div>
<div class="p1">
<span style="background-color: #eeeeee; font-family: Courier New, Courier, monospace;"><span class="s1"> Applying sessions.0001_initial...</span><span class="s2"> OK</span></span></div>
<div class="p1">
<span style="background-color: #eeeeee; font-family: Courier New, Courier, monospace;"><span class="s1"> Applying tagging.0001_initial...</span><span class="s2"> OK</span></span></div>
<div class="p3">
<span style="background-color: #eeeeee; font-family: Courier New, Courier, monospace;"><span class="s1"></span><br /></span></div>
<div class="p1">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;">You have installed Django's auth system, and don't have any superusers defined.</span></span></div>
<div class="p1">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;">Would you like to create one now? (yes/no): yes</span></span></div>
<div class="p1">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;">Username (leave blank to use 'root'): </span></span></div>
<div class="p1">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;">Email address: me@mydomain.org</span></span></div>
<div class="p1">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;">Password: </span></span></div>
<div class="p1">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;">Password (again): </span></span></div>
<div>
<span style="background-color: #eeeeee; font-family: Courier New, Courier, monospace;">Superuser created successfully.</span></div>
<div>
<span style="background-color: #eeeeee; font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="background-color: #eeeeee; font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div>
<span style="background-color: white; font-family: inherit;">Adjust the resolution and hold time for the carbon storage engine in </span><span style="background-color: white; font-family: Courier New, Courier, monospace;">/etc/opt/csw/graphite/storage-schemas.conf</span><span style="background-color: white; font-family: inherit;">:</span></div>
<div>
<span style="background-color: white; font-family: inherit;"><br /></span></div>
<div>
<div class="p1">
<span class="s1" style="background-color: #eeeeee;"><span style="font-family: Courier New, Courier, monospace;">retentions = 10s:1h, 1m:7d, 15m:30d, 1h:2y</span></span></div>
</div>
<div>
<br /></div>
<span style="font-family: inherit;">Then </span><span style="font-family: Courier New, Courier, monospace;">carbon-cache</span><span style="font-family: inherit;"> can be started with</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span>
<span style="background-color: #eeeeee; font-family: 'Courier New', Courier, monospace;"># svcadm enable carbon-cache</span><br />
<br /></div>
<div style="min-height: 14px;">
<span style="font-family: inherit;">We can now setup the Apache Virtual Host by adding this line to </span><span style="font-family: Courier New, Courier, monospace;">/opt/csw/apache2/etc/httpd.conf</span><span style="font-family: inherit;">:</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span>
<span style="background-color: #eeeeee; font-family: 'Courier New', Courier, monospace;">Include etc/extra/httpd-graphite-vhost.conf</span></div>
<div style="min-height: 14px;">
<br />
<div style="min-height: 14px;">
Adjust permissions:</div>
<div>
<span style="background-color: #eeeeee; font-family: Courier New, Courier, monospace;"># chown -R nobody:nobody /var/opt/csw/graphite</span></div>
<span style="font-family: inherit;"><br /></span>
Restart Apache:<br />
<span style="background-color: #eeeeee; font-family: 'Courier New', Courier, monospace;"># svcadm restart cswapache2</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">Everything is now running and it should now be possible to connect to Apache.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
</div>
Dagobert Michelsenhttp://www.blogger.com/profile/00917619439571581481noreply@blogger.com0tag:blogger.com,1999:blog-7161844769281505351.post-9648401590409484632008-10-22T12:35:00.000-07:002008-11-06T22:51:31.817-08:00OpenCSW IRL MeetingPeter and Dago had the idea that people interested in OpenCSW could meet in real life. We decided that the meeting will take place on 6th December in Switzerland's biggest city Zurich.<br /><br />One of the goals of this meeting is to found the OpenCSW foundation. The foundation should be non-commercial, define the project goals and own all the names and domains to prevent abuse.<br /><br />Technical workshops are also planned.<br /><br />All maintainers and people who want to become OpenCSW maintainers are welcome to join this meeting. If you would like join, please send an e-mail to <a href="mailto:ihsan@opencsw.org">ihsan@</a><at><a href="mailto:ihsan@opencsw.org">opencsw.org</a>.<br /><br />More information is available on <a href="http://wiki.opencsw.org/irl-meeting">http://wiki.opencsw.org/irl-meeting</a>.<br /></at>Ihsan Doganhttp://www.blogger.com/profile/16135015144783463172noreply@blogger.com0